<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Unsafe #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, RoleAnnotations #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  GHC.Arr</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow, 1994-2000</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  cvs-ghc@haskell.org</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  non-portable (GHC extensions)</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- GHC\'s array implementation.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Arr</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier">Ix</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier">Array</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier">STArray</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier">arrEleBottom</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#array"><span class="hs-identifier">array</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#listArray"><span class="hs-identifier">listArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#%21"><span class="hs-operator">(!)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#safeRangeSize"><span class="hs-identifier">safeRangeSize</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#negRange"><span class="hs-identifier">negRange</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier">safeIndex</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#badSafeIndex"><span class="hs-identifier">badSafeIndex</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#bounds"><span class="hs-identifier">bounds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#numElements"><span class="hs-identifier">numElements</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#numElementsSTArray"><span class="hs-identifier">numElementsSTArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#indices"><span class="hs-identifier">indices</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#elems"><span class="hs-identifier">elems</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#assocs"><span class="hs-identifier">assocs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#accumArray"><span class="hs-identifier">accumArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#adjust"><span class="hs-identifier">adjust</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#%2F%2F"><span class="hs-operator">(//)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#accum"><span class="hs-identifier">accum</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#amap"><span class="hs-identifier">amap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#ixmap"><span class="hs-identifier">ixmap</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#eqArray"><span class="hs-identifier">eqArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#cmpArray"><span class="hs-identifier">cmpArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#cmpIntArray"><span class="hs-identifier">cmpIntArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#newSTArray"><span class="hs-identifier">newSTArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#boundsSTArray"><span class="hs-identifier">boundsSTArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#readSTArray"><span class="hs-identifier">readSTArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#writeSTArray"><span class="hs-identifier">writeSTArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#freezeSTArray"><span class="hs-identifier">freezeSTArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#thawSTArray"><span class="hs-identifier">thawSTArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#foldlElems"><span class="hs-identifier">foldlElems</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldlElems%27"><span class="hs-identifier">foldlElems'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldl1Elems"><span class="hs-identifier">foldl1Elems</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#foldrElems"><span class="hs-identifier">foldrElems</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldrElems%27"><span class="hs-identifier">foldrElems'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldr1Elems"><span class="hs-identifier">foldr1Elems</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Unsafe operations</span></span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#fill"><span class="hs-identifier">fill</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#done"><span class="hs-identifier">done</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#unsafeArray"><span class="hs-identifier">unsafeArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeArray%27"><span class="hs-identifier">unsafeArray'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#lessSafeIndex"><span class="hs-identifier">lessSafeIndex</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier">unsafeAt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeReplace"><span class="hs-identifier">unsafeReplace</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#unsafeAccumArray"><span class="hs-identifier">unsafeAccumArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeAccumArray%27"><span class="hs-identifier">unsafeAccumArray'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeAccum"><span class="hs-identifier">unsafeAccum</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#unsafeReadSTArray"><span class="hs-identifier">unsafeReadSTArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeWriteSTArray"><span class="hs-identifier">unsafeWriteSTArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="GHC.Arr.html#unsafeFreezeSTArray"><span class="hs-identifier">unsafeFreezeSTArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeThawSTArray"><span class="hs-identifier">unsafeThawSTArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Num.html"><span class="hs-identifier">GHC.Num</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.ST.html"><span class="hs-identifier">GHC.ST</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.List.html"><span class="hs-identifier">GHC.List</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Ix.html"><span class="hs-identifier">GHC.Ix</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Show.html"><span class="hs-identifier">GHC.Show</span></a></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">9</span><span>  </span><span class="annot"><a href="GHC.Arr.html#%21"><span class="hs-operator hs-type">!</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Arr.html#%2F%2F"><span class="hs-operator hs-type">//</span></a></span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">default</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-comment">-- | The type of immutable non-strict (boxed) arrays</span><span>
</span><span id="line-56"></span><span class="hs-comment">-- with indices in @i@ and elements in @e@.</span><span>
</span><span id="line-57"></span><span class="hs-keyword">data</span><span> </span><span id="Array"><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-var">Array</span></a></span></span><span> </span><span id="local-6989586621679501328"><span class="annot"><a href="#local-6989586621679501328"><span class="hs-identifier hs-type">i</span></a></span></span><span> </span><span id="local-6989586621679501327"><span class="annot"><a href="#local-6989586621679501327"><span class="hs-identifier hs-type">e</span></a></span></span><span>
</span><span id="line-58"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="Array"><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-var">Array</span></a></span></span><span>            </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621679501328"><span class="hs-identifier hs-type">i</span></a></span><span>         </span><span class="hs-comment">-- the lower bound, l</span><span>
</span><span id="line-59"></span><span>                      </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621679501328"><span class="hs-identifier hs-type">i</span></a></span><span>         </span><span class="hs-comment">-- the upper bound, u</span><span>
</span><span id="line-60"></span><span>       </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>       </span><span class="hs-comment">-- A cache of (rangeSize (l,u))</span><span>
</span><span id="line-61"></span><span>                                 </span><span class="hs-comment">-- used to make sure an index is</span><span>
</span><span id="line-62"></span><span>                                 </span><span class="hs-comment">-- really in range</span><span>
</span><span id="line-63"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Array%23"><span class="hs-identifier hs-type">Array#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501327"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- The actual elements</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-comment">-- | Mutable, boxed, non-strict arrays in the 'ST' monad.  The type</span><span>
</span><span id="line-66"></span><span class="hs-comment">-- arguments are as follows:</span><span>
</span><span id="line-67"></span><span class="hs-comment">--</span><span>
</span><span id="line-68"></span><span class="hs-comment">--  * @s@: the state variable argument for the 'ST' type</span><span>
</span><span id="line-69"></span><span class="hs-comment">--</span><span>
</span><span id="line-70"></span><span class="hs-comment">--  * @i@: the index type of the array (should be an instance of 'Ix')</span><span>
</span><span id="line-71"></span><span class="hs-comment">--</span><span>
</span><span id="line-72"></span><span class="hs-comment">--  * @e@: the element type of the array.</span><span>
</span><span id="line-73"></span><span class="hs-comment">--</span><span>
</span><span id="line-74"></span><span class="hs-keyword">data</span><span> </span><span id="STArray"><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-var">STArray</span></a></span></span><span> </span><span id="local-6989586621679501129"><span class="annot"><a href="#local-6989586621679501129"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span id="local-6989586621679501130"><span class="annot"><a href="#local-6989586621679501130"><span class="hs-identifier hs-type">i</span></a></span></span><span> </span><span id="local-6989586621679501128"><span class="annot"><a href="#local-6989586621679501128"><span class="hs-identifier hs-type">e</span></a></span></span><span>
</span><span id="line-75"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="STArray"><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-var">STArray</span></a></span></span><span>           </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621679501130"><span class="hs-identifier hs-type">i</span></a></span><span>               </span><span class="hs-comment">-- the lower bound, l</span><span>
</span><span id="line-76"></span><span>                      </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621679501130"><span class="hs-identifier hs-type">i</span></a></span><span>               </span><span class="hs-comment">-- the upper bound, u</span><span>
</span><span id="line-77"></span><span>      </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>             </span><span class="hs-comment">-- A cache of (rangeSize (l,u))</span><span>
</span><span id="line-78"></span><span>                                       </span><span class="hs-comment">-- used to make sure an index is</span><span>
</span><span id="line-79"></span><span>                                       </span><span class="hs-comment">-- really in range</span><span>
</span><span id="line-80"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableArray%23"><span class="hs-identifier hs-type">MutableArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501129"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501128"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- The actual elements</span><span>
</span><span id="line-81"></span><span>        </span><span class="hs-comment">-- No Ix context for STArray.  They are stupid,</span><span>
</span><span id="line-82"></span><span>        </span><span class="hs-comment">-- and force an Ix context on the equality instance.</span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-comment">-- Index types should have nominal role, because of Ix class. See also #9220.</span><span>
</span><span id="line-85"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">role</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="hs-identifier">nominal</span></span><span> </span><span class="annot"><span class="hs-identifier">representational</span></span><span>
</span><span id="line-86"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">role</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><span class="hs-identifier">nominal</span></span><span> </span><span class="annot"><span class="hs-identifier">nominal</span></span><span> </span><span class="annot"><span class="hs-identifier">representational</span></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span class="hs-comment">-- Just pointer equality on mutable arrays:</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-90"></span><span id="local-6989586621679501373"><span id="local-6989586621679501374"><span id="local-6989586621679501375"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679500997"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501375"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501374"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501373"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-91"></span><span>    </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500995"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500995"><span class="hs-identifier hs-var">arr1#</span></a></span></span><span> </span><span id="local-6989586621679500994"><span class="annot"><span class="annottext">== :: STArray s i e -&gt; STArray s i e -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></a></span></span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500993"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500993"><span class="hs-identifier hs-var">arr2#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-92"></span><span>        </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MutableArray# s e -&gt; MutableArray# s e -&gt; Int#
forall d a. MutableArray# d a -&gt; MutableArray# d a -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#sameMutableArray%23"><span class="hs-identifier hs-var">sameMutableArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500995"><span class="hs-identifier hs-var">arr1#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500993"><span class="hs-identifier hs-var">arr2#</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span class="hs-comment">----------------------------------------------------------------------</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- Operations on immutable arrays</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#arrEleBottom"><span class="hs-pragma hs-type">arrEleBottom</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-98"></span><span id="local-6989586621679501370"><span class="annot"><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier hs-type">arrEleBottom</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679501370"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-99"></span><span id="arrEleBottom"><span class="annot"><span class="annottext">arrEleBottom :: forall a. a
</span><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier hs-var hs-var">arrEleBottom</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; a
forall a. [Char] -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;(Array.!): undefined array element&quot;</span></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="hs-comment">-- | Construct an array with the specified bounds and containing values</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- for given indices within these bounds.</span><span>
</span><span id="line-103"></span><span class="hs-comment">--</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- The array is undefined (i.e. bottom) if any index in the list is</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- out of bounds.  The Haskell 2010 Report further specifies that if any</span><span>
</span><span id="line-106"></span><span class="hs-comment">-- two associations in the list have the same index, the value at that</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- index is undefined (i.e. bottom).  However in GHC's implementation,</span><span>
</span><span id="line-108"></span><span class="hs-comment">-- the value at such an index is the value part of the last association</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- with that index in the list.</span><span>
</span><span id="line-110"></span><span class="hs-comment">--</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- Because the indices must be checked for these errors, 'array' is</span><span>
</span><span id="line-112"></span><span class="hs-comment">-- strict in the bounds argument and in the indices of the association</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- list, but non-strict in the values.  Thus, recurrences such as the</span><span>
</span><span id="line-114"></span><span class="hs-comment">-- following are possible:</span><span>
</span><span id="line-115"></span><span class="hs-comment">--</span><span>
</span><span id="line-116"></span><span class="hs-comment">-- &gt; a = array (1,100) ((1,1) : [(i, i * a!(i-1)) | i &lt;- [2..100]])</span><span>
</span><span id="line-117"></span><span class="hs-comment">--</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- Not every index within the bounds of the array need appear in the</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- association list, but the values associated with indices that do not</span><span>
</span><span id="line-120"></span><span class="hs-comment">-- appear will be undefined (i.e. bottom).</span><span>
</span><span id="line-121"></span><span class="hs-comment">--</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- If, in any dimension, the lower bound is greater than the upper bound,</span><span>
</span><span id="line-123"></span><span class="hs-comment">-- then the array is legal, but empty.  Indexing an empty array always</span><span>
</span><span id="line-124"></span><span class="hs-comment">-- gives an array-bounds error, but 'bounds' still yields the bounds</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- with which the array was constructed.</span><span>
</span><span id="line-126"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#array"><span class="hs-pragma hs-type">array</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-127"></span><span id="local-6989586621679501365"><span id="local-6989586621679501366"><span class="annot"><a href="GHC.Arr.html#array"><span class="hs-identifier hs-type">array</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501366"><span class="hs-identifier hs-type">i</span></a></span><span>
</span><span id="line-128"></span><span>        </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501366"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501366"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span>        </span><span class="hs-comment">-- ^ a pair of /bounds/, each of the index type</span><span>
</span><span id="line-129"></span><span>                        </span><span class="hs-comment">-- of the array.  These bounds are the lowest and</span><span>
</span><span id="line-130"></span><span>                        </span><span class="hs-comment">-- highest indices in the array, in that order.</span><span>
</span><span id="line-131"></span><span>                        </span><span class="hs-comment">-- For example, a one-origin vector of length</span><span>
</span><span id="line-132"></span><span>                        </span><span class="hs-comment">-- @10@ has bounds @(1,10)@, and a one-origin @10@</span><span>
</span><span id="line-133"></span><span>                        </span><span class="hs-comment">-- by @10@ matrix has bounds @((1,1),(10,10))@.</span><span>
</span><span id="line-134"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501366"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501365"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- ^ a list of /associations/ of the form</span><span>
</span><span id="line-135"></span><span>                        </span><span class="hs-comment">-- (/index/, /value/).  Typically, this list will</span><span>
</span><span id="line-136"></span><span>                        </span><span class="hs-comment">-- be expressed as a comprehension.  An</span><span>
</span><span id="line-137"></span><span>                        </span><span class="hs-comment">-- association @(i, x)@ defines the value of</span><span>
</span><span id="line-138"></span><span>                        </span><span class="hs-comment">-- the array at index @i@ to be @x@.</span><span>
</span><span id="line-139"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501366"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501365"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-140"></span><span id="array"><span class="annot"><span class="annottext">array :: forall i e. Ix i =&gt; (i, i) -&gt; [(i, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#array"><span class="hs-identifier hs-var hs-var">array</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500988"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500988"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500987"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500987"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500986"><span class="annot"><span class="annottext">[(i, e)]
</span><a href="#local-6989586621679500986"><span class="hs-identifier hs-var">ies</span></a></span></span><span>
</span><span id="line-141"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679500984"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500984"><span class="hs-identifier hs-var hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Arr.html#safeRangeSize"><span class="hs-identifier hs-var">safeRangeSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500988"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500987"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>      </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; [(Int, e)] -&gt; Array i e
forall i e. (i, i) -&gt; Int -&gt; [(Int, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeArray%27"><span class="hs-identifier hs-var">unsafeArray'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500988"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500987"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500984"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-143"></span><span>                      </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500988"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500987"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500984"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500983"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500982"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500983"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500983"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500982"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500982"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(i, e)]
</span><a href="#local-6989586621679500986"><span class="hs-identifier hs-var">ies</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeArray"><span class="hs-pragma hs-type">unsafeArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-146"></span><span id="local-6989586621679501357"><span id="local-6989586621679501358"><span class="annot"><a href="GHC.Arr.html#unsafeArray"><span class="hs-identifier hs-type">unsafeArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501358"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501358"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501358"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501357"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501358"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501357"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-147"></span><span id="unsafeArray"><span class="annot"><span class="annottext">unsafeArray :: forall i e. Ix i =&gt; (i, i) -&gt; [(Int, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeArray"><span class="hs-identifier hs-var hs-var">unsafeArray</span></a></span></span><span> </span><span id="local-6989586621679500979"><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679500979"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679500978"><span class="annot"><span class="annottext">[(Int, e)]
</span><a href="#local-6989586621679500978"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; [(Int, e)] -&gt; Array i e
forall i e. (i, i) -&gt; Int -&gt; [(Int, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeArray%27"><span class="hs-identifier hs-var">unsafeArray'</span></a></span><span> </span><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679500979"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Ix.html#rangeSize"><span class="hs-identifier hs-var">rangeSize</span></a></span><span> </span><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679500979"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Int, e)]
</span><a href="#local-6989586621679500978"><span class="hs-identifier hs-var">ies</span></a></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeArray%27"><span class="hs-pragma hs-type">unsafeArray'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-150"></span><span id="local-6989586621679501360"><span id="local-6989586621679501361"><span class="annot"><a href="GHC.Arr.html#unsafeArray%27"><span class="hs-identifier hs-type">unsafeArray'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501361"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501361"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501360"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501361"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501360"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-151"></span><span id="unsafeArray%27"><span class="annot"><span class="annottext">unsafeArray' :: forall i e. (i, i) -&gt; Int -&gt; [(Int, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeArray%27"><span class="hs-identifier hs-var hs-var">unsafeArray'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500976"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500976"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500975"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500975"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500974"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500974"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500973"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500973"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500972"><span class="annot"><span class="annottext">[(Int, e)]
</span><a href="#local-6989586621679500972"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s (Array i e)) -&gt; Array i e
forall a. (forall s. ST s a) -&gt; a
</span><a href="GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STRep s (Array i e) -&gt; ST s (Array i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (Array i e) -&gt; ST s (Array i e))
-&gt; STRep s (Array i e) -&gt; ST s (Array i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500969"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500969"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-152"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; e -&gt; State# s -&gt; (# State# s, MutableArray# s e #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500973"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">e
forall a. a
</span><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier hs-var">arrEleBottom</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500969"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-153"></span><span>        </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500968"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500968"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500967"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500967"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-154"></span><span>            </span><span class="annot"><span class="annottext">((Int, e) -&gt; STRep s (Array i e) -&gt; STRep s (Array i e))
-&gt; STRep s (Array i e) -&gt; [(Int, e)] -&gt; STRep s (Array i e)
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MutableArray# s e
-&gt; (Int, e) -&gt; STRep s (Array i e) -&gt; STRep s (Array i e)
forall s e a.
MutableArray# s e -&gt; (Int, e) -&gt; STRep s a -&gt; STRep s a
</span><a href="GHC.Arr.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500967"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500976"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500975"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500974"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500967"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Int, e)]
</span><a href="#local-6989586621679500972"><span class="hs-identifier hs-var">ies</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500968"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#fill"><span class="hs-pragma hs-type">fill</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-157"></span><span id="local-6989586621679501338"><span id="local-6989586621679501339"><span id="local-6989586621679501340"><span class="annot"><a href="GHC.Arr.html#fill"><span class="hs-identifier hs-type">fill</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableArray%23"><span class="hs-identifier hs-type">MutableArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501340"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501339"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501339"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#STRep"><span class="hs-identifier hs-type">STRep</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501340"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501338"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#STRep"><span class="hs-identifier hs-type">STRep</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501340"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501338"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- NB: put the \s after the &quot;=&quot; so that 'fill'</span><span>
</span><span id="line-159"></span><span class="hs-comment">--     inlines when applied to three args</span><span>
</span><span id="line-160"></span><span id="fill"><span class="annot"><span class="annottext">fill :: forall s e a.
MutableArray# s e -&gt; (Int, e) -&gt; STRep s a -&gt; STRep s a
</span><a href="GHC.Arr.html#fill"><span class="hs-identifier hs-var hs-var">fill</span></a></span></span><span> </span><span id="local-6989586621679500966"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500966"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500965"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500965"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500964"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500964"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500963"><span class="annot"><span class="annottext">STRep s a
</span><a href="#local-6989586621679500963"><span class="hs-identifier hs-var">next</span></a></span></span><span>
</span><span id="line-161"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500962"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500962"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; e -&gt; State# s -&gt; State# s
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeArray%23"><span class="hs-identifier hs-var">writeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500966"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500965"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500964"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500962"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-162"></span><span>             </span><span id="local-6989586621679500961"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500961"><span class="hs-identifier hs-var">s2#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">STRep s a
</span><a href="#local-6989586621679500963"><span class="hs-identifier hs-var">next</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500961"><span class="hs-identifier hs-var">s2#</span></a></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#done"><span class="hs-pragma hs-type">done</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-165"></span><span id="local-6989586621679501335"><span id="local-6989586621679501336"><span id="local-6989586621679501337"><span class="annot"><a href="GHC.Arr.html#done"><span class="hs-identifier hs-type">done</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679501337"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501337"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableArray%23"><span class="hs-identifier hs-type">MutableArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501336"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501335"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#STRep"><span class="hs-identifier hs-type">STRep</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501336"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501337"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501335"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-166"></span><span class="hs-comment">-- See NB on 'fill'</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- Make sure it is strict in 'n'</span><span>
</span><span id="line-168"></span><span id="done"><span class="annot"><span class="annottext">done :: forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var hs-var">done</span></a></span></span><span> </span><span id="local-6989586621679500960"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500960"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500959"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500959"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500958"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500958"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500957"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500957"><span class="hs-identifier hs-var">marr#</span></a></span></span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500956"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500956"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; State# s -&gt; (# State# s, Array# e #)
forall d a.
MutableArray# d a -&gt; State# d -&gt; (# State# d, Array# a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#unsafeFreezeArray%23"><span class="hs-identifier hs-var">unsafeFreezeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500957"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500956"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-170"></span><span>              </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500955"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500955"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500954"><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500954"><span class="hs-identifier hs-var">arr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500955"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; Array# e -&gt; Array i e
forall i e. i -&gt; i -&gt; Int -&gt; Array# e -&gt; Array i e
</span><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-var">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500960"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500959"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500958"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500954"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="hs-comment">-- | Construct an array from a pair of bounds and a list of values in</span><span>
</span><span id="line-173"></span><span class="hs-comment">-- index order.</span><span>
</span><span id="line-174"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#listArray"><span class="hs-pragma hs-type">listArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-175"></span><span id="local-6989586621679501325"><span id="local-6989586621679501326"><span class="annot"><a href="GHC.Arr.html#listArray"><span class="hs-identifier hs-type">listArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501326"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501326"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501326"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679501325"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501326"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501325"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-176"></span><span id="listArray"><span class="annot"><span class="annottext">listArray :: forall i e. Ix i =&gt; (i, i) -&gt; [e] -&gt; Array i e
</span><a href="GHC.Arr.html#listArray"><span class="hs-identifier hs-var hs-var">listArray</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500952"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500952"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500951"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500951"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500950"><span class="annot"><span class="annottext">[e]
</span><a href="#local-6989586621679500950"><span class="hs-identifier hs-var">es</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s (Array i e)) -&gt; Array i e
forall a. (forall s. ST s a) -&gt; a
</span><a href="GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STRep s (Array i e) -&gt; ST s (Array i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (Array i e) -&gt; ST s (Array i e))
-&gt; STRep s (Array i e) -&gt; ST s (Array i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500944"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500944"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-177"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Arr.html#safeRangeSize"><span class="hs-identifier hs-var">safeRangeSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500952"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500951"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>            </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679500943"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500943"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500942"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500942"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-178"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; e -&gt; State# s -&gt; (# State# s, MutableArray# s e #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500942"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">e
forall a. a
</span><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier hs-var">arrEleBottom</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500944"><span class="hs-identifier hs-var">s1#</span></a></span><span>  </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500941"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500941"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500940"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500940"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-179"></span><span>      </span><span class="hs-keyword">let</span><span>
</span><span id="line-180"></span><span>        </span><span id="local-6989586621679500939"><span class="annot"><span class="annottext">go :: e -&gt; (Int# -&gt; State# s -&gt; State# s) -&gt; Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500939"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500938"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500938"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679500937"><span class="annot"><span class="annottext">Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500937"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679500936"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500936"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span id="local-6989586621679500935"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500935"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-181"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; e -&gt; State# s -&gt; State# s
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeArray%23"><span class="hs-identifier hs-var">writeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500940"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500936"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500938"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500935"><span class="hs-identifier hs-var">s3#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-182"></span><span>              </span><span id="local-6989586621679500934"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500934"><span class="hs-identifier hs-var">s4#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500936"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3D%3D%23"><span class="hs-operator hs-var">==#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500942"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#-%23"><span class="hs-operator hs-var">-#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>                     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500934"><span class="hs-identifier hs-var">s4#</span></a></span><span>
</span><span id="line-184"></span><span>                     </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500937"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500936"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500934"><span class="hs-identifier hs-var">s4#</span></a></span><span>
</span><span id="line-185"></span><span>      </span><span class="hs-keyword">in</span><span>
</span><span id="line-186"></span><span>        </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500952"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500951"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500943"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500940"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-187"></span><span>          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500943"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-188"></span><span>          </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500941"><span class="hs-identifier hs-var">s2#</span></a></span><span>
</span><span id="line-189"></span><span>          </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(e
 -&gt; (Int# -&gt; State# s -&gt; State# s) -&gt; Int# -&gt; State# s -&gt; State# s)
-&gt; (Int# -&gt; State# s -&gt; State# s)
-&gt; [e]
-&gt; Int#
-&gt; State# s
-&gt; State# s
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; (Int# -&gt; State# s -&gt; State# s) -&gt; Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500939"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Int#
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500933"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500933"><span class="hs-identifier hs-var">s#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500933"><span class="hs-identifier hs-var">s#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[e]
</span><a href="#local-6989586621679500950"><span class="hs-identifier hs-var">es</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500941"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">)</span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span class="hs-comment">-- | The value at the given index in an array.</span><span>
</span><span id="line-192"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">!</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-193"></span><span id="local-6989586621679501320"><span id="local-6989586621679501321"><span class="annot"><a href="GHC.Arr.html#%21"><span class="hs-operator hs-type">(!)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501321"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501321"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501320"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501321"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501320"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-194"></span><span id="%21"><span class="annot"><span class="annottext">! :: forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="GHC.Arr.html#%21"><span class="hs-operator hs-var hs-var">(!)</span></a></span></span><span> </span><span id="local-6989586621679500930"><span class="annot"><span class="annottext">arr :: Array i e
</span><a href="#local-6989586621679500930"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500929"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500929"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500928"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500928"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500927"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500927"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500926"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500926"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; Int -&gt; e
forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var">unsafeAt</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500930"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; e) -&gt; Int -&gt; e
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500929"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500928"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500927"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500926"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">!#</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-197"></span><span id="local-6989586621679501314"><span id="local-6989586621679501315"><span class="annot"><a href="GHC.Arr.html#%21%23"><span class="hs-operator hs-type">(!#)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501315"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501315"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501314"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501315"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><a href="#local-6989586621679501314"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">#)</span></span></span><span>
</span><span id="line-198"></span><span id="%21%23"><span class="annot"><span class="annottext">!# :: forall i e. Ix i =&gt; Array i e -&gt; i -&gt; (# e #)
</span><a href="GHC.Arr.html#%21%23"><span class="hs-operator hs-var hs-var">(!#)</span></a></span></span><span> </span><span id="local-6989586621679500922"><span class="annot"><span class="annottext">arr :: Array i e
</span><a href="#local-6989586621679500922"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500921"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500921"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500920"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500920"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500919"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500919"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500918"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500918"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; Int -&gt; (# e #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500922"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; (# e #)) -&gt; Int -&gt; (# e #)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500921"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500920"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500919"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500918"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#safeRangeSize"><span class="hs-pragma hs-type">safeRangeSize</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-201"></span><span id="local-6989586621679501362"><span class="annot"><a href="GHC.Arr.html#safeRangeSize"><span class="hs-identifier hs-type">safeRangeSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501362"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501362"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501362"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span></span><span>
</span><span id="line-202"></span><span id="safeRangeSize"><span class="annot"><span class="annottext">safeRangeSize :: forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Arr.html#safeRangeSize"><span class="hs-identifier hs-var hs-var">safeRangeSize</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500912"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500912"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500911"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500911"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679500909"><span class="annot"><span class="annottext">r :: Int
</span><a href="#local-6989586621679500909"><span class="hs-identifier hs-var hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Ix.html#rangeSize"><span class="hs-identifier hs-var">rangeSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500912"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500911"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-203"></span><span>                      </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500909"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Arr.html#negRange"><span class="hs-identifier hs-var">negRange</span></a></span><span>
</span><span id="line-204"></span><span>                                  </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500909"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span class="hs-comment">-- Don't inline this error message everywhere!!</span><span>
</span><span id="line-207"></span><span class="annot"><a href="GHC.Arr.html#negRange"><span class="hs-identifier hs-type">negRange</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>   </span><span class="hs-comment">-- Uninformative, but Ix does not provide Show</span><span>
</span><span id="line-208"></span><span id="negRange"><span class="annot"><span class="annottext">negRange :: Int
</span><a href="GHC.Arr.html#negRange"><span class="hs-identifier hs-var hs-var">negRange</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall a. [Char] -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Negative range size&quot;</span></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="hs-pragma">{-# INLINE</span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Arr.html#safeIndex"><span class="hs-pragma hs-type">safeIndex</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-211"></span><span class="hs-comment">-- See Note [Double bounds-checking of index values]</span><span>
</span><span id="line-212"></span><span class="hs-comment">-- Inline *after* (!) so the rules can fire</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- Make sure it is strict in n</span><span>
</span><span id="line-214"></span><span id="local-6989586621679501359"><span class="annot"><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-type">safeIndex</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501359"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501359"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501359"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501359"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span></span><span>
</span><span id="line-215"></span><span id="safeIndex"><span class="annot"><span class="annottext">safeIndex :: forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var hs-var">safeIndex</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500903"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500903"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500902"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500902"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500901"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500901"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500900"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500900"><span class="hs-identifier hs-var">i</span></a></span></span><span>
</span><span id="line-216"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500898"><span class="hs-identifier hs-var">i'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500898"><span class="hs-identifier hs-var">i'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500901"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500898"><span class="hs-identifier hs-var">i'</span></a></span><span>
</span><span id="line-217"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
</span><a href="GHC.Arr.html#badSafeIndex"><span class="hs-identifier hs-var">badSafeIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500898"><span class="hs-identifier hs-var">i'</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500901"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-219"></span><span>    </span><span id="local-6989586621679500898"><span class="annot"><span class="annottext">i' :: Int
</span><a href="#local-6989586621679500898"><span class="hs-identifier hs-var hs-var">i'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; i -&gt; Int
forall a. Ix a =&gt; (a, a) -&gt; a -&gt; Int
</span><a href="GHC.Ix.html#index"><span class="hs-identifier hs-var">index</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500903"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500902"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500900"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span class="hs-comment">-- See Note [Double bounds-checking of index values]</span><span>
</span><span id="line-222"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-223"></span><span class="annot"><span class="hs-pragma">&quot;safeIndex/I&quot;</span></span><span>       </span><span class="annot"><a href="GHC.Arr.html#safeIndex"><span class="hs-pragma hs-type">safeIndex</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Arr.html#lessSafeIndex"><span class="hs-pragma hs-type">lessSafeIndex</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span>
</span><span id="line-224"></span><span class="annot"><span class="hs-pragma">&quot;safeIndex/(I,I)&quot;</span></span><span>   </span><span class="annot"><a href="GHC.Arr.html#safeIndex"><span class="hs-pragma hs-type">safeIndex</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Arr.html#lessSafeIndex"><span class="hs-pragma hs-type">lessSafeIndex</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">,</span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span>
</span><span id="line-225"></span><span class="annot"><span class="hs-pragma">&quot;safeIndex/(I,I,I)&quot;</span></span><span> </span><span class="annot"><a href="GHC.Arr.html#safeIndex"><span class="hs-pragma hs-type">safeIndex</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Arr.html#lessSafeIndex"><span class="hs-pragma hs-type">lessSafeIndex</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">,</span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-pragma hs-type">Int</span></a></span><span>
</span><span id="line-226"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span id="local-6989586621679500894"><span class="annot"><a href="GHC.Arr.html#lessSafeIndex"><span class="hs-identifier hs-type">lessSafeIndex</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500894"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679500894"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679500894"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500894"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span></span><span>
</span><span id="line-229"></span><span class="hs-comment">-- See Note [Double bounds-checking of index values]</span><span>
</span><span id="line-230"></span><span class="hs-comment">-- Do only (A), the semantic check</span><span>
</span><span id="line-231"></span><span id="lessSafeIndex"><span class="annot"><span class="annottext">lessSafeIndex :: forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#lessSafeIndex"><span class="hs-identifier hs-var hs-var">lessSafeIndex</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500891"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500891"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500890"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500890"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500889"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500889"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; i -&gt; Int
forall a. Ix a =&gt; (a, a) -&gt; a -&gt; Int
</span><a href="GHC.Ix.html#index"><span class="hs-identifier hs-var">index</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500891"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500890"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500889"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span class="hs-comment">-- Don't inline this long error message everywhere!!</span><span>
</span><span id="line-234"></span><span class="annot"><a href="GHC.Arr.html#badSafeIndex"><span class="hs-identifier hs-type">badSafeIndex</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-235"></span><span id="badSafeIndex"><span class="annot"><span class="annottext">badSafeIndex :: Int -&gt; Int -&gt; Int
</span><a href="GHC.Arr.html#badSafeIndex"><span class="hs-identifier hs-var hs-var">badSafeIndex</span></a></span></span><span> </span><span id="local-6989586621679500888"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500888"><span class="hs-identifier hs-var">i'</span></a></span></span><span> </span><span id="local-6989586621679500887"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500887"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall a. [Char] -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Error in array index; &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500888"><span class="hs-identifier hs-var">i'</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-236"></span><span>                        </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot; not in range [0..&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500887"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;)&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeAt"><span class="hs-pragma hs-type">unsafeAt</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-239"></span><span id="local-6989586621679501316"><span id="local-6989586621679501317"><span class="annot"><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-type">unsafeAt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501317"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501316"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501316"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-240"></span><span id="unsafeAt"><span class="annot"><span class="annottext">unsafeAt :: forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var hs-var">unsafeAt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500885"><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500885"><span class="hs-identifier hs-var">arr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500884"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500884"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-241"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Array# e -&gt; Int# -&gt; (# e #)
forall a. Array# a -&gt; Int# -&gt; (# a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#indexArray%23"><span class="hs-identifier hs-var">indexArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500885"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500884"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500883"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500883"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500883"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span class="hs-comment">-- | Look up an element in an array without forcing it</span><span>
</span><span id="line-244"></span><span id="local-6989586621679501310"><span id="local-6989586621679501311"><span class="annot"><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-type">unsafeAt#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501311"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501310"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><a href="#local-6989586621679501310"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-special">#)</span></span></span><span>
</span><span id="line-245"></span><span id="unsafeAt%23"><span class="annot"><span class="annottext">unsafeAt# :: forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var hs-var">unsafeAt#</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500882"><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500882"><span class="hs-identifier hs-var">arr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500881"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500881"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array# e -&gt; Int# -&gt; (# e #)
forall a. Array# a -&gt; Int# -&gt; (# a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#indexArray%23"><span class="hs-identifier hs-var">indexArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500882"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500881"><span class="hs-identifier hs-var">i#</span></a></span><span>
</span><span id="line-246"></span><span>
</span><span id="line-247"></span><span class="hs-comment">-- | A convenient version of unsafeAt#</span><span>
</span><span id="line-248"></span><span id="local-6989586621679501296"><span id="local-6989586621679501297"><span id="local-6989586621679501298"><span class="annot"><a href="GHC.Arr.html#unsafeAtA"><span class="hs-identifier hs-type">unsafeAtA</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501298"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-249"></span><span>          </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501297"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501296"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501298"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501296"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-250"></span><span id="unsafeAtA"><span class="annot"><span class="annottext">unsafeAtA :: forall (f :: * -&gt; *) i e. Applicative f =&gt; Array i e -&gt; Int -&gt; f e
</span><a href="GHC.Arr.html#unsafeAtA"><span class="hs-identifier hs-var hs-var">unsafeAtA</span></a></span></span><span> </span><span id="local-6989586621679500877"><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500877"><span class="hs-identifier hs-var">ary</span></a></span></span><span> </span><span id="local-6989586621679500876"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500876"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; Int -&gt; (# e #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500877"><span class="hs-identifier hs-var">ary</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500876"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500875"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500875"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e -&gt; f e
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500875"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span class="hs-comment">-- | The bounds with which an array was constructed.</span><span>
</span><span id="line-253"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#bounds"><span class="hs-pragma hs-type">bounds</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-254"></span><span id="local-6989586621679501289"><span id="local-6989586621679501290"><span class="annot"><a href="GHC.Arr.html#bounds"><span class="hs-identifier hs-type">bounds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501290"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501289"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501290"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501290"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-255"></span><span id="bounds"><span class="annot"><span class="annottext">bounds :: forall i e. Array i e -&gt; (i, i)
</span><a href="GHC.Arr.html#bounds"><span class="hs-identifier hs-var hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500874"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500874"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500873"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500873"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500874"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500873"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-256"></span><span>
</span><span id="line-257"></span><span class="hs-comment">-- | The number of elements in the array.</span><span>
</span><span id="line-258"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#numElements"><span class="hs-pragma hs-type">numElements</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-259"></span><span id="local-6989586621679501285"><span id="local-6989586621679501286"><span class="annot"><a href="GHC.Arr.html#numElements"><span class="hs-identifier hs-type">numElements</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501286"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501285"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span></span></span><span>
</span><span id="line-260"></span><span id="numElements"><span class="annot"><span class="annottext">numElements :: forall i e. Array i e -&gt; Int
</span><a href="GHC.Arr.html#numElements"><span class="hs-identifier hs-var hs-var">numElements</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500872"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500872"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500872"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="hs-comment">-- | The list of indices of an array in ascending order.</span><span>
</span><span id="line-263"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#indices"><span class="hs-pragma hs-type">indices</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-264"></span><span id="local-6989586621679501281"><span id="local-6989586621679501282"><span class="annot"><a href="GHC.Arr.html#indices"><span class="hs-identifier hs-type">indices</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501282"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501282"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501281"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679501282"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-265"></span><span id="indices"><span class="annot"><span class="annottext">indices :: forall i e. Ix i =&gt; Array i e -&gt; [i]
</span><a href="GHC.Arr.html#indices"><span class="hs-identifier hs-var hs-var">indices</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500869"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500869"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500868"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500868"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; [i]
forall a. Ix a =&gt; (a, a) -&gt; [a]
</span><a href="GHC.Ix.html#range"><span class="hs-identifier hs-var">range</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500869"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500868"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span class="hs-comment">-- | The list of elements of an array in index order.</span><span>
</span><span id="line-268"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#elems"><span class="hs-pragma hs-type">elems</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-269"></span><span id="local-6989586621679501277"><span id="local-6989586621679501278"><span class="annot"><a href="GHC.Arr.html#elems"><span class="hs-identifier hs-type">elems</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501278"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501277"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679501277"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-270"></span><span id="elems"><span class="annot"><span class="annottext">elems :: forall i e. Array i e -&gt; [e]
</span><a href="GHC.Arr.html#elems"><span class="hs-identifier hs-var hs-var">elems</span></a></span></span><span> </span><span id="local-6989586621679500859"><span class="annot"><span class="annottext">arr :: Array i e
</span><a href="#local-6989586621679500859"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500858"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500858"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-271"></span><span>    </span><span class="hs-special">[</span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500857"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679500856"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500856"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500858"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500857"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500857"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; Int -&gt; [e]
forall (f :: * -&gt; *) i e. Applicative f =&gt; Array i e -&gt; Int -&gt; f e
</span><a href="GHC.Arr.html#unsafeAtA"><span class="hs-identifier hs-var">unsafeAtA</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500859"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500856"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span class="hs-comment">-- | A right fold over the elements</span><span>
</span><span id="line-274"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldrElems"><span class="hs-pragma hs-type">foldrElems</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-275"></span><span id="local-6989586621679501271"><span id="local-6989586621679501272"><span id="local-6989586621679501273"><span class="annot"><a href="GHC.Arr.html#foldrElems"><span class="hs-identifier hs-type">foldrElems</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501273"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501272"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501272"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501272"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501271"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501273"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501272"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-276"></span><span id="foldrElems"><span class="annot"><span class="annottext">foldrElems :: forall a b i. (a -&gt; b -&gt; b) -&gt; b -&gt; Array i a -&gt; b
</span><a href="GHC.Arr.html#foldrElems"><span class="hs-identifier hs-var hs-var">foldrElems</span></a></span></span><span> </span><span id="local-6989586621679500855"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679500855"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500854"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500854"><span class="hs-identifier hs-var">b0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679500853"><span class="annot"><span class="annottext">arr :: Array i a
</span><a href="#local-6989586621679500853"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500852"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500852"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-277"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-278"></span><span>    </span><span id="local-6989586621679500848"><span class="annot"><span class="annottext">go :: Int -&gt; b
</span><a href="#local-6989586621679500848"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500847"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500847"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500847"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500852"><span class="hs-identifier hs-var">n</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500854"><span class="hs-identifier hs-var">b0</span></a></span><span>
</span><span id="line-279"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500846"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500846"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; (# a #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500853"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500847"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-280"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679500855"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500846"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; b
</span><a href="#local-6989586621679500848"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500847"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Int -&gt; b
</span><a href="#local-6989586621679500848"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span class="hs-comment">-- | A left fold over the elements</span><span>
</span><span id="line-284"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldlElems"><span class="hs-pragma hs-type">foldlElems</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-285"></span><span id="local-6989586621679501265"><span id="local-6989586621679501266"><span id="local-6989586621679501267"><span class="annot"><a href="GHC.Arr.html#foldlElems"><span class="hs-identifier hs-type">foldlElems</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501267"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501266"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501267"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501267"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501265"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501266"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501267"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-286"></span><span id="foldlElems"><span class="annot"><span class="annottext">foldlElems :: forall b a i. (b -&gt; a -&gt; b) -&gt; b -&gt; Array i a -&gt; b
</span><a href="GHC.Arr.html#foldlElems"><span class="hs-identifier hs-var hs-var">foldlElems</span></a></span></span><span> </span><span id="local-6989586621679500842"><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679500842"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500841"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500841"><span class="hs-identifier hs-var">b0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679500840"><span class="annot"><span class="annottext">arr :: Array i a
</span><a href="#local-6989586621679500840"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500839"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500839"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-287"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-288"></span><span>    </span><span id="local-6989586621679500833"><span class="annot"><span class="annottext">go :: Int -&gt; b
</span><a href="#local-6989586621679500833"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500832"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500832"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500832"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500841"><span class="hs-identifier hs-var">b0</span></a></span><span>
</span><span id="line-289"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500831"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500831"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; (# a #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500840"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500832"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-290"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679500842"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; b
</span><a href="#local-6989586621679500833"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500832"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500831"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-291"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Int -&gt; b
</span><a href="#local-6989586621679500833"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500839"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="hs-comment">-- | A strict right fold over the elements</span><span>
</span><span id="line-294"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldrElems%27"><span class="hs-pragma hs-type">foldrElems'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-295"></span><span id="local-6989586621679500828"><span id="local-6989586621679500829"><span id="local-6989586621679500830"><span class="annot"><a href="GHC.Arr.html#foldrElems%27"><span class="hs-identifier hs-type">foldrElems'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679500830"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500829"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500829"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500829"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500828"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500830"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500829"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-296"></span><span id="foldrElems%27"><span class="annot"><span class="annottext">foldrElems' :: forall a b i. (a -&gt; b -&gt; b) -&gt; b -&gt; Array i a -&gt; b
</span><a href="GHC.Arr.html#foldrElems%27"><span class="hs-identifier hs-var hs-var">foldrElems'</span></a></span></span><span> </span><span id="local-6989586621679500825"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679500825"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500824"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500824"><span class="hs-identifier hs-var">b0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679500823"><span class="annot"><span class="annottext">arr :: Array i a
</span><a href="#local-6989586621679500823"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500822"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500822"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-297"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-298"></span><span>    </span><span id="local-6989586621679500816"><span class="annot"><span class="annottext">go :: Int -&gt; b -&gt; b
</span><a href="#local-6989586621679500816"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500815"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500815"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679500814"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500814"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500815"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500814"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-299"></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500813"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500813"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; (# a #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500823"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500815"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-300"></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; b -&gt; b
</span><a href="#local-6989586621679500816"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500815"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679500825"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500813"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; b) -&gt; b -&gt; b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500814"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-301"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Int -&gt; b -&gt; b
</span><a href="#local-6989586621679500816"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500822"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500824"><span class="hs-identifier hs-var">b0</span></a></span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span class="hs-comment">-- | A strict left fold over the elements</span><span>
</span><span id="line-304"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldlElems%27"><span class="hs-pragma hs-type">foldlElems'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-305"></span><span id="local-6989586621679500809"><span id="local-6989586621679500810"><span id="local-6989586621679500811"><span class="annot"><a href="GHC.Arr.html#foldlElems%27"><span class="hs-identifier hs-type">foldlElems'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679500811"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500810"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500811"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500811"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500809"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500810"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500811"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-306"></span><span id="foldlElems%27"><span class="annot"><span class="annottext">foldlElems' :: forall b a i. (b -&gt; a -&gt; b) -&gt; b -&gt; Array i a -&gt; b
</span><a href="GHC.Arr.html#foldlElems%27"><span class="hs-identifier hs-var hs-var">foldlElems'</span></a></span></span><span> </span><span id="local-6989586621679500808"><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679500808"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500807"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500807"><span class="hs-identifier hs-var">b0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679500806"><span class="annot"><span class="annottext">arr :: Array i a
</span><a href="#local-6989586621679500806"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500805"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500805"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-308"></span><span>    </span><span id="local-6989586621679500801"><span class="annot"><span class="annottext">go :: Int -&gt; b -&gt; b
</span><a href="#local-6989586621679500801"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500800"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500800"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679500799"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500799"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500800"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500805"><span class="hs-identifier hs-var">n</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500799"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-309"></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500798"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500798"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; (# a #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500806"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500800"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-310"></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; b -&gt; b
</span><a href="#local-6989586621679500801"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500800"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500799"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679500808"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500799"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500798"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Int -&gt; b -&gt; b
</span><a href="#local-6989586621679500801"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679500807"><span class="hs-identifier hs-var">b0</span></a></span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="hs-comment">-- | A left fold over the elements with no starting value</span><span>
</span><span id="line-314"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldl1Elems"><span class="hs-pragma hs-type">foldl1Elems</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-315"></span><span id="local-6989586621679501252"><span id="local-6989586621679501253"><span class="annot"><a href="GHC.Arr.html#foldl1Elems"><span class="hs-identifier hs-type">foldl1Elems</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501253"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501253"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501253"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501252"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501253"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501253"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-316"></span><span id="foldl1Elems"><span class="annot"><span class="annottext">foldl1Elems :: forall a i. (a -&gt; a -&gt; a) -&gt; Array i a -&gt; a
</span><a href="GHC.Arr.html#foldl1Elems"><span class="hs-identifier hs-var hs-var">foldl1Elems</span></a></span></span><span> </span><span id="local-6989586621679500793"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679500793"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679500792"><span class="annot"><span class="annottext">arr :: Array i a
</span><a href="#local-6989586621679500792"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500791"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500791"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-317"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-318"></span><span>    </span><span id="local-6989586621679500786"><span class="annot"><span class="annottext">go :: Int -&gt; a
</span><a href="#local-6989586621679500786"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500785"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500785"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500785"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; a
forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var">unsafeAt</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500792"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-319"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500784"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500784"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; (# a #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500792"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500785"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-320"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679500793"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; a
</span><a href="#local-6989586621679500786"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500785"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500784"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-321"></span><span>  </span><span class="hs-keyword">in</span><span>
</span><span id="line-322"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500791"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; a
forall a. [Char] -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;foldl1: empty Array&quot;</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int -&gt; a
</span><a href="#local-6989586621679500786"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500791"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">-- | A right fold over the elements with no starting value</span><span>
</span><span id="line-325"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Arr.html#foldr1Elems"><span class="hs-pragma hs-type">foldr1Elems</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-326"></span><span id="local-6989586621679500782"><span id="local-6989586621679500783"><span class="annot"><a href="GHC.Arr.html#foldr1Elems"><span class="hs-identifier hs-type">foldr1Elems</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679500783"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500783"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500783"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500782"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500783"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500783"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-327"></span><span id="foldr1Elems"><span class="annot"><span class="annottext">foldr1Elems :: forall a i. (a -&gt; a -&gt; a) -&gt; Array i a -&gt; a
</span><a href="GHC.Arr.html#foldr1Elems"><span class="hs-identifier hs-var hs-var">foldr1Elems</span></a></span></span><span> </span><span id="local-6989586621679500779"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679500779"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679500778"><span class="annot"><span class="annottext">arr :: Array i a
</span><a href="#local-6989586621679500778"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500777"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500777"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-328"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-329"></span><span>    </span><span id="local-6989586621679500771"><span class="annot"><span class="annottext">go :: Int -&gt; a
</span><a href="#local-6989586621679500771"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500770"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500770"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500770"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500777"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; a
forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var">unsafeAt</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500778"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500770"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-330"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500769"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500769"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; (# a #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500778"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500770"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-331"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679500779"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500769"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; a
</span><a href="#local-6989586621679500771"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500770"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>  </span><span class="hs-keyword">in</span><span>
</span><span id="line-333"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500777"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; a
forall a. [Char] -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;foldr1: empty Array&quot;</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int -&gt; a
</span><a href="#local-6989586621679500771"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span class="hs-comment">-- | The list of associations of an array in index order.</span><span>
</span><span id="line-336"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#assocs"><span class="hs-pragma hs-type">assocs</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-337"></span><span id="local-6989586621679501246"><span id="local-6989586621679501247"><span class="annot"><a href="GHC.Arr.html#assocs"><span class="hs-identifier hs-type">assocs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501247"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501247"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501246"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501247"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501246"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span></span></span><span>
</span><span id="line-338"></span><span id="assocs"><span class="annot"><span class="annottext">assocs :: forall i e. Ix i =&gt; Array i e -&gt; [(i, e)]
</span><a href="GHC.Arr.html#assocs"><span class="hs-identifier hs-var hs-var">assocs</span></a></span></span><span> </span><span id="local-6989586621679500766"><span class="annot"><span class="annottext">arr :: Array i e
</span><a href="#local-6989586621679500766"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500765"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500765"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500764"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500764"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-339"></span><span>    </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500763"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500762"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679500763"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500763"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; [i]
forall a. Ix a =&gt; (a, a) -&gt; [a]
</span><a href="GHC.Ix.html#range"><span class="hs-identifier hs-var">range</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500765"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500764"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500762"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500762"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500766"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; i -&gt; (# e #)
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; (# e #)
</span><a href="GHC.Arr.html#%21%23"><span class="hs-operator hs-var">!#</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500763"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span class="hs-comment">-- | The 'accumArray' function deals with repeated indices in the association</span><span>
</span><span id="line-342"></span><span class="hs-comment">-- list using an /accumulating function/ which combines the values of</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- associations with the same index.</span><span>
</span><span id="line-344"></span><span class="hs-comment">--</span><span>
</span><span id="line-345"></span><span class="hs-comment">-- For example, given a list of values of some index type, @hist@</span><span>
</span><span id="line-346"></span><span class="hs-comment">-- produces a histogram of the number of occurrences of each index within</span><span>
</span><span id="line-347"></span><span class="hs-comment">-- a specified range:</span><span>
</span><span id="line-348"></span><span class="hs-comment">--</span><span>
</span><span id="line-349"></span><span class="hs-comment">-- &gt; hist :: (Ix a, Num b) =&gt; (a,a) -&gt; [a] -&gt; Array a b</span><span>
</span><span id="line-350"></span><span class="hs-comment">-- &gt; hist bnds is = accumArray (+) 0 bnds [(i, 1) | i&lt;-is, inRange bnds i]</span><span>
</span><span id="line-351"></span><span class="hs-comment">--</span><span>
</span><span id="line-352"></span><span class="hs-comment">-- @accumArray@ is strict in each result of applying the accumulating</span><span>
</span><span id="line-353"></span><span class="hs-comment">-- function, although it is lazy in the initial value. Thus, unlike</span><span>
</span><span id="line-354"></span><span class="hs-comment">-- arrays built with 'array', accumulated arrays should not in general</span><span>
</span><span id="line-355"></span><span class="hs-comment">-- be recursive.</span><span>
</span><span id="line-356"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#accumArray"><span class="hs-pragma hs-type">accumArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-357"></span><span id="local-6989586621679501241"><span id="local-6989586621679501242"><span id="local-6989586621679501243"><span class="annot"><a href="GHC.Arr.html#accumArray"><span class="hs-identifier hs-type">accumArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501243"><span class="hs-identifier hs-type">i</span></a></span><span>
</span><span id="line-358"></span><span>        </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501242"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501241"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501242"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span>        </span><span class="hs-comment">-- ^ accumulating function</span><span>
</span><span id="line-359"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501242"><span class="hs-identifier hs-type">e</span></a></span><span>                    </span><span class="hs-comment">-- ^ initial value</span><span>
</span><span id="line-360"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501243"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501243"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span>                </span><span class="hs-comment">-- ^ bounds of the array</span><span>
</span><span id="line-361"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501243"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501241"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>             </span><span class="hs-comment">-- ^ association list</span><span>
</span><span id="line-362"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501243"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501242"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-363"></span><span id="accumArray"><span class="annot"><span class="annottext">accumArray :: forall i e a.
Ix i =&gt;
(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; [(i, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#accumArray"><span class="hs-identifier hs-var hs-var">accumArray</span></a></span></span><span> </span><span id="local-6989586621679500758"><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500758"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500757"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500757"><span class="hs-identifier hs-var">initial</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500756"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500756"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500755"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500755"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500754"><span class="annot"><span class="annottext">[(i, a)]
</span><a href="#local-6989586621679500754"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-364"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679500752"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500752"><span class="hs-identifier hs-var hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Arr.html#safeRangeSize"><span class="hs-identifier hs-var">safeRangeSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500756"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500755"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; Int -&gt; [(Int, a)] -&gt; Array i e
forall e a i.
(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; Int -&gt; [(Int, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeAccumArray%27"><span class="hs-identifier hs-var">unsafeAccumArray'</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500758"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500757"><span class="hs-identifier hs-var">initial</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500756"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500755"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500752"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-366"></span><span>                         </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500756"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500755"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500752"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500751"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500750"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500751"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500751"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500750"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500750"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(i, a)]
</span><a href="#local-6989586621679500754"><span class="hs-identifier hs-var">ies</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-367"></span><span>
</span><span id="line-368"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeAccumArray"><span class="hs-pragma hs-type">unsafeAccumArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-369"></span><span id="local-6989586621679501232"><span id="local-6989586621679501233"><span id="local-6989586621679501234"><span class="annot"><a href="GHC.Arr.html#unsafeAccumArray"><span class="hs-identifier hs-type">unsafeAccumArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501234"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501233"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501232"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501233"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501233"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501234"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501234"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501232"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501234"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501233"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-370"></span><span id="unsafeAccumArray"><span class="annot"><span class="annottext">unsafeAccumArray :: forall i e a.
Ix i =&gt;
(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; [(Int, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeAccumArray"><span class="hs-identifier hs-var hs-var">unsafeAccumArray</span></a></span></span><span> </span><span id="local-6989586621679500747"><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500747"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500746"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500746"><span class="hs-identifier hs-var">initial</span></a></span></span><span> </span><span id="local-6989586621679500745"><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679500745"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679500744"><span class="annot"><span class="annottext">[(Int, a)]
</span><a href="#local-6989586621679500744"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; Int -&gt; [(Int, a)] -&gt; Array i e
forall e a i.
(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; Int -&gt; [(Int, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeAccumArray%27"><span class="hs-identifier hs-var">unsafeAccumArray'</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500747"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500746"><span class="hs-identifier hs-var">initial</span></a></span><span> </span><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679500745"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Ix.html#rangeSize"><span class="hs-identifier hs-var">rangeSize</span></a></span><span> </span><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679500745"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Int, a)]
</span><a href="#local-6989586621679500744"><span class="hs-identifier hs-var">ies</span></a></span><span>
</span><span id="line-371"></span><span>
</span><span id="line-372"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeAccumArray%27"><span class="hs-pragma hs-type">unsafeAccumArray'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-373"></span><span id="local-6989586621679501235"><span id="local-6989586621679501236"><span id="local-6989586621679501237"><span class="annot"><a href="GHC.Arr.html#unsafeAccumArray%27"><span class="hs-identifier hs-type">unsafeAccumArray'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501237"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501236"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501237"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501237"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501235"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501235"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501236"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501235"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501237"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-374"></span><span id="unsafeAccumArray%27"><span class="annot"><span class="annottext">unsafeAccumArray' :: forall e a i.
(e -&gt; a -&gt; e) -&gt; e -&gt; (i, i) -&gt; Int -&gt; [(Int, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeAccumArray%27"><span class="hs-identifier hs-var hs-var">unsafeAccumArray'</span></a></span></span><span> </span><span id="local-6989586621679500743"><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500743"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500742"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500742"><span class="hs-identifier hs-var">initial</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500741"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500741"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500740"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500740"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500739"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500739"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500738"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500738"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500737"><span class="annot"><span class="annottext">[(Int, a)]
</span><a href="#local-6989586621679500737"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s (Array i e)) -&gt; Array i e
forall a. (forall s. ST s a) -&gt; a
</span><a href="GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STRep s (Array i e) -&gt; ST s (Array i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (Array i e) -&gt; ST s (Array i e))
-&gt; STRep s (Array i e) -&gt; ST s (Array i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500736"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500736"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-375"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; e -&gt; State# s -&gt; (# State# s, MutableArray# s e #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500738"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500742"><span class="hs-identifier hs-var">initial</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500736"><span class="hs-identifier hs-var">s1#</span></a></span><span>          </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500735"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500735"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500734"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500734"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-376"></span><span>    </span><span class="annot"><span class="annottext">((Int, a) -&gt; STRep s (Array i e) -&gt; STRep s (Array i e))
-&gt; STRep s (Array i e) -&gt; [(Int, a)] -&gt; STRep s (Array i e)
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; a -&gt; e)
-&gt; MutableArray# s e
-&gt; (Int, a)
-&gt; STRep s (Array i e)
-&gt; STRep s (Array i e)
forall e a s b.
(e -&gt; a -&gt; e)
-&gt; MutableArray# s e -&gt; (Int, a) -&gt; STRep s b -&gt; STRep s b
</span><a href="GHC.Arr.html#adjust%27"><span class="hs-identifier hs-var">adjust'</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500743"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500734"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500741"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500740"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500739"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500734"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Int, a)]
</span><a href="#local-6989586621679500737"><span class="hs-identifier hs-var">ies</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500735"><span class="hs-identifier hs-var">s2#</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#adjust"><span class="hs-pragma hs-type">adjust</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-379"></span><span id="local-6989586621679500729"><span id="local-6989586621679500730"><span id="local-6989586621679500731"><span id="local-6989586621679500732"><span class="annot"><a href="GHC.Arr.html#adjust"><span class="hs-identifier hs-type">adjust</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679500732"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500731"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679500732"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableArray%23"><span class="hs-identifier hs-type">MutableArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500730"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500732"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679500731"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#STRep"><span class="hs-identifier hs-type">STRep</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500730"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500729"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#STRep"><span class="hs-identifier hs-type">STRep</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500730"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500729"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span><span>
</span><span id="line-380"></span><span class="hs-comment">-- See NB on 'fill'</span><span>
</span><span id="line-381"></span><span id="adjust"><span class="annot"><span class="annottext">adjust :: forall e a s b.
(e -&gt; a -&gt; e)
-&gt; MutableArray# s e -&gt; (Int, a) -&gt; STRep s b -&gt; STRep s b
</span><a href="GHC.Arr.html#adjust"><span class="hs-identifier hs-var hs-var">adjust</span></a></span></span><span> </span><span id="local-6989586621679500728"><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500728"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500727"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500727"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500726"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500726"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500725"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500725"><span class="hs-identifier hs-var">new</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500724"><span class="annot"><span class="annottext">STRep s b
</span><a href="#local-6989586621679500724"><span class="hs-identifier hs-var">next</span></a></span></span><span>
</span><span id="line-382"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500723"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500723"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; State# s -&gt; (# State# s, e #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#readArray%23"><span class="hs-identifier hs-var">readArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500727"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500726"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500723"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-383"></span><span>                </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500722"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500722"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500721"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500721"><span class="hs-identifier hs-var">old</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-384"></span><span>                    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; e -&gt; State# s -&gt; State# s
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeArray%23"><span class="hs-identifier hs-var">writeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500727"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500726"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500728"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500721"><span class="hs-identifier hs-var">old</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500725"><span class="hs-identifier hs-var">new</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500722"><span class="hs-identifier hs-var">s2#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-385"></span><span>                        </span><span id="local-6989586621679500720"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500720"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">STRep s b
</span><a href="#local-6989586621679500724"><span class="hs-identifier hs-var">next</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500720"><span class="hs-identifier hs-var">s3#</span></a></span><span>
</span><span id="line-386"></span><span>
</span><span id="line-387"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#adjust%27"><span class="hs-pragma hs-type">adjust'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-388"></span><span id="local-6989586621679501221"><span id="local-6989586621679501222"><span id="local-6989586621679501223"><span id="local-6989586621679501224"><span class="annot"><a href="GHC.Arr.html#adjust%27"><span class="hs-identifier hs-type">adjust'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501224"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501223"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501224"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableArray%23"><span class="hs-identifier hs-type">MutableArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501222"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501224"><span class="hs-identifier hs-type">e</span></a></span><span>
</span><span id="line-390"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501223"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-391"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#STRep"><span class="hs-identifier hs-type">STRep</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501222"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501221"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#STRep"><span class="hs-identifier hs-type">STRep</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501222"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501221"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span><span>
</span><span id="line-392"></span><span id="adjust%27"><span class="annot"><span class="annottext">adjust' :: forall e a s b.
(e -&gt; a -&gt; e)
-&gt; MutableArray# s e -&gt; (Int, a) -&gt; STRep s b -&gt; STRep s b
</span><a href="GHC.Arr.html#adjust%27"><span class="hs-identifier hs-var hs-var">adjust'</span></a></span></span><span> </span><span id="local-6989586621679500719"><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500719"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500718"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500718"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500717"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500717"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500716"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500716"><span class="hs-identifier hs-var">new</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500715"><span class="annot"><span class="annottext">STRep s b
</span><a href="#local-6989586621679500715"><span class="hs-identifier hs-var">next</span></a></span></span><span>
</span><span id="line-393"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500714"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500714"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; State# s -&gt; (# State# s, e #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#readArray%23"><span class="hs-identifier hs-var">readArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500718"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500717"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500714"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-394"></span><span>                </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500713"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500713"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500712"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500712"><span class="hs-identifier hs-var">old</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-395"></span><span>                    </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679500711"><span class="annot"><span class="annottext">combined :: e
</span><a href="#local-6989586621679500711"><span class="hs-identifier hs-var hs-var">combined</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500719"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500712"><span class="hs-identifier hs-var">old</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500716"><span class="hs-identifier hs-var">new</span></a></span><span>
</span><span id="line-396"></span><span>                    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">STRep s b
</span><a href="#local-6989586621679500715"><span class="hs-identifier hs-var">next</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; e -&gt; State# s -&gt; State# s
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeArray%23"><span class="hs-identifier hs-var">writeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500718"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500717"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500711"><span class="hs-identifier hs-var">combined</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500713"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>
</span><span id="line-398"></span><span>
</span><span id="line-399"></span><span class="hs-comment">-- | Constructs an array identical to the first argument except that it has</span><span>
</span><span id="line-400"></span><span class="hs-comment">-- been updated by the associations in the right argument.</span><span>
</span><span id="line-401"></span><span class="hs-comment">-- For example, if @m@ is a 1-origin, @n@ by @n@ matrix, then</span><span>
</span><span id="line-402"></span><span class="hs-comment">--</span><span>
</span><span id="line-403"></span><span class="hs-comment">-- &gt; m//[((i,i), 0) | i &lt;- [1..n]]</span><span>
</span><span id="line-404"></span><span class="hs-comment">--</span><span>
</span><span id="line-405"></span><span class="hs-comment">-- is the same matrix, except with the diagonal zeroed.</span><span>
</span><span id="line-406"></span><span class="hs-comment">--</span><span>
</span><span id="line-407"></span><span class="hs-comment">-- Repeated indices in the association list are handled as for 'array':</span><span>
</span><span id="line-408"></span><span class="hs-comment">-- Haskell 2010 specifies that the resulting array is undefined (i.e. bottom),</span><span>
</span><span id="line-409"></span><span class="hs-comment">-- but GHC's implementation uses the last association for each index.</span><span>
</span><span id="line-410"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">//</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-411"></span><span id="local-6989586621679501211"><span id="local-6989586621679501212"><span class="annot"><a href="GHC.Arr.html#%2F%2F"><span class="hs-operator hs-type">(//)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501212"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501212"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501211"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501212"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501211"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501212"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501211"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-412"></span><span id="local-6989586621679500708"><span class="annot"><span class="annottext">arr :: Array i e
</span><a href="#local-6989586621679500708"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500707"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500707"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500706"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500706"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500705"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500705"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="%2F%2F"><span class="annot"><span class="annottext">// :: forall i e. Ix i =&gt; Array i e -&gt; [(i, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#%2F%2F"><span class="hs-operator hs-var hs-var">//</span></a></span></span><span> </span><span id="local-6989586621679500704"><span class="annot"><span class="annottext">[(i, e)]
</span><a href="#local-6989586621679500704"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-413"></span><span>    </span><span class="annot"><span class="annottext">Array i e -&gt; [(Int, e)] -&gt; Array i e
forall i e. Array i e -&gt; [(Int, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeReplace"><span class="hs-identifier hs-var">unsafeReplace</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500708"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500707"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500706"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500705"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500703"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500702"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500703"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500703"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500702"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500702"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(i, e)]
</span><a href="#local-6989586621679500704"><span class="hs-identifier hs-var">ies</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeReplace"><span class="hs-pragma hs-type">unsafeReplace</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-416"></span><span id="local-6989586621679501207"><span id="local-6989586621679501208"><span class="annot"><a href="GHC.Arr.html#unsafeReplace"><span class="hs-identifier hs-type">unsafeReplace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501208"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501207"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501207"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501208"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501207"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-417"></span><span id="unsafeReplace"><span class="annot"><span class="annottext">unsafeReplace :: forall i e. Array i e -&gt; [(Int, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeReplace"><span class="hs-identifier hs-var hs-var">unsafeReplace</span></a></span></span><span> </span><span id="local-6989586621679500701"><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500701"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679500700"><span class="annot"><span class="annottext">[(Int, e)]
</span><a href="#local-6989586621679500700"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s (Array i e)) -&gt; Array i e
forall a. (forall s. ST s a) -&gt; a
</span><a href="GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span>
</span><span id="line-418"></span><span>    </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span id="local-6989586621679500697"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500697"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500696"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500696"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500695"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500695"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679500694"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500694"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; ST s (STArray s i e)
forall i e s. Array i e -&gt; ST s (STArray s i e)
</span><a href="GHC.Arr.html#thawSTArray"><span class="hs-identifier hs-var">thawSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500701"><span class="hs-identifier hs-var">arr</span></a></span><span>
</span><span id="line-419"></span><span>    </span><span class="annot"><span class="annottext">STRep s (Array i e) -&gt; ST s (Array i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Int, e) -&gt; STRep s (Array i e) -&gt; STRep s (Array i e))
-&gt; STRep s (Array i e) -&gt; [(Int, e)] -&gt; STRep s (Array i e)
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MutableArray# s e
-&gt; (Int, e) -&gt; STRep s (Array i e) -&gt; STRep s (Array i e)
forall s e a.
MutableArray# s e -&gt; (Int, e) -&gt; STRep s a -&gt; STRep s a
</span><a href="GHC.Arr.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500694"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500697"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500696"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500695"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500694"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Int, e)]
</span><a href="#local-6989586621679500700"><span class="hs-identifier hs-var">ies</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-420"></span><span>
</span><span id="line-421"></span><span class="hs-comment">-- | @'accum' f@ takes an array and an association list and accumulates</span><span>
</span><span id="line-422"></span><span class="hs-comment">-- pairs from the list into the array with the accumulating function @f@.</span><span>
</span><span id="line-423"></span><span class="hs-comment">-- Thus 'accumArray' can be defined using 'accum':</span><span>
</span><span id="line-424"></span><span class="hs-comment">--</span><span>
</span><span id="line-425"></span><span class="hs-comment">-- &gt; accumArray f z b = accum f (array b [(i, z) | i &lt;- range b])</span><span>
</span><span id="line-426"></span><span class="hs-comment">--</span><span>
</span><span id="line-427"></span><span class="hs-comment">-- @accum@ is strict in all the results of applying the accumulation.</span><span>
</span><span id="line-428"></span><span class="hs-comment">-- However, it is lazy in the initial values of the array.</span><span>
</span><span id="line-429"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#accum"><span class="hs-pragma hs-type">accum</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-430"></span><span id="local-6989586621679501197"><span id="local-6989586621679501198"><span id="local-6989586621679501199"><span class="annot"><a href="GHC.Arr.html#accum"><span class="hs-identifier hs-type">accum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501199"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501198"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501197"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501198"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501199"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501198"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501199"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501197"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501199"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501198"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-431"></span><span id="accum"><span class="annot"><span class="annottext">accum :: forall i e a.
Ix i =&gt;
(e -&gt; a -&gt; e) -&gt; Array i e -&gt; [(i, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#accum"><span class="hs-identifier hs-var hs-var">accum</span></a></span></span><span> </span><span id="local-6989586621679500691"><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500691"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500690"><span class="annot"><span class="annottext">arr :: Array i e
</span><a href="#local-6989586621679500690"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500689"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500689"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500688"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500688"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500687"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500687"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500686"><span class="annot"><span class="annottext">[(i, a)]
</span><a href="#local-6989586621679500686"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-432"></span><span>    </span><span class="annot"><span class="annottext">(e -&gt; a -&gt; e) -&gt; Array i e -&gt; [(Int, a)] -&gt; Array i e
forall e a i. (e -&gt; a -&gt; e) -&gt; Array i e -&gt; [(Int, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeAccum"><span class="hs-identifier hs-var">unsafeAccum</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500691"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500690"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500689"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500688"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500687"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500685"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500684"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500685"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500685"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500684"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500684"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(i, a)]
</span><a href="#local-6989586621679500686"><span class="hs-identifier hs-var">ies</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeAccum"><span class="hs-pragma hs-type">unsafeAccum</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-435"></span><span id="local-6989586621679501191"><span id="local-6989586621679501192"><span id="local-6989586621679501193"><span class="annot"><a href="GHC.Arr.html#unsafeAccum"><span class="hs-identifier hs-type">unsafeAccum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501193"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501192"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501193"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501191"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501193"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679501192"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501191"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501193"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-436"></span><span id="unsafeAccum"><span class="annot"><span class="annottext">unsafeAccum :: forall e a i. (e -&gt; a -&gt; e) -&gt; Array i e -&gt; [(Int, a)] -&gt; Array i e
</span><a href="GHC.Arr.html#unsafeAccum"><span class="hs-identifier hs-var hs-var">unsafeAccum</span></a></span></span><span> </span><span id="local-6989586621679500683"><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500683"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500682"><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500682"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679500681"><span class="annot"><span class="annottext">[(Int, a)]
</span><a href="#local-6989586621679500681"><span class="hs-identifier hs-var">ies</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s (Array i e)) -&gt; Array i e
forall a. (forall s. ST s a) -&gt; a
</span><a href="GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span>
</span><span id="line-437"></span><span>    </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span id="local-6989586621679500679"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500679"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500678"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500678"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500677"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500677"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679500676"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500676"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; ST s (STArray s i e)
forall i e s. Array i e -&gt; ST s (STArray s i e)
</span><a href="GHC.Arr.html#thawSTArray"><span class="hs-identifier hs-var">thawSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500682"><span class="hs-identifier hs-var">arr</span></a></span><span>
</span><span id="line-438"></span><span>    </span><span class="annot"><span class="annottext">STRep s (Array i e) -&gt; ST s (Array i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Int, a) -&gt; STRep s (Array i e) -&gt; STRep s (Array i e))
-&gt; STRep s (Array i e) -&gt; [(Int, a)] -&gt; STRep s (Array i e)
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; a -&gt; e)
-&gt; MutableArray# s e
-&gt; (Int, a)
-&gt; STRep s (Array i e)
-&gt; STRep s (Array i e)
forall e a s b.
(e -&gt; a -&gt; e)
-&gt; MutableArray# s e -&gt; (Int, a) -&gt; STRep s b -&gt; STRep s b
</span><a href="GHC.Arr.html#adjust%27"><span class="hs-identifier hs-var">adjust'</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; a -&gt; e
</span><a href="#local-6989586621679500683"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500676"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500679"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500678"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500677"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500676"><span class="hs-identifier hs-var">marr#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Int, a)]
</span><a href="#local-6989586621679500681"><span class="hs-identifier hs-var">ies</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Arr.html#amap"><span class="hs-pragma hs-type">amap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>  </span><span class="hs-comment">-- See Note [amap]</span><span>
</span><span id="line-441"></span><span id="local-6989586621679501184"><span id="local-6989586621679501185"><span id="local-6989586621679501186"><span class="annot"><a href="GHC.Arr.html#amap"><span class="hs-identifier hs-type">amap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501186"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501185"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501184"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501186"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501184"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501185"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-442"></span><span id="amap"><span class="annot"><span class="annottext">amap :: forall a b i. (a -&gt; b) -&gt; Array i a -&gt; Array i b
</span><a href="GHC.Arr.html#amap"><span class="hs-identifier hs-var hs-var">amap</span></a></span></span><span> </span><span id="local-6989586621679500675"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679500675"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500674"><span class="annot"><span class="annottext">arr :: Array i a
</span><a href="#local-6989586621679500674"><span class="hs-identifier hs-var">arr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500673"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500673"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500672"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500672"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500671"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500671"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500670"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500670"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Array# a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s (Array i b)) -&gt; Array i b
forall a. (forall s. ST s a) -&gt; a
</span><a href="GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STRep s (Array i b) -&gt; ST s (Array i b)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (Array i b) -&gt; ST s (Array i b))
-&gt; STRep s (Array i b) -&gt; ST s (Array i b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500669"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500669"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-443"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; b -&gt; State# s -&gt; (# State# s, MutableArray# s b #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500670"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">b
forall a. a
</span><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier hs-var">arrEleBottom</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500669"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-444"></span><span>        </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500668"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500668"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500667"><span class="annot"><span class="annottext">MutableArray# s b
</span><a href="#local-6989586621679500667"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-445"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679500663"><span class="annot"><span class="annottext">go :: Int -&gt; STRep s (Array i b)
</span><a href="#local-6989586621679500663"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679500662"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500662"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679500661"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500661"><span class="hs-identifier hs-var">s#</span></a></span></span><span>
</span><span id="line-446"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500662"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500671"><span class="hs-identifier hs-var">n</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s b -&gt; STRep s (Array i b)
forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500673"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500672"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500671"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s b
</span><a href="#local-6989586621679500667"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500661"><span class="hs-identifier hs-var">s#</span></a></span><span>
</span><span id="line-447"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500660"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500660"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Array i a -&gt; Int -&gt; (# a #)
forall i e. Array i e -&gt; Int -&gt; (# e #)
</span><a href="GHC.Arr.html#unsafeAt%23"><span class="hs-identifier hs-var">unsafeAt#</span></a></span><span> </span><span class="annot"><span class="annottext">Array i a
</span><a href="#local-6989586621679500674"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500662"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-448"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MutableArray# s b
-&gt; (Int, b) -&gt; STRep s (Array i b) -&gt; STRep s (Array i b)
forall s e a.
MutableArray# s e -&gt; (Int, e) -&gt; STRep s a -&gt; STRep s a
</span><a href="GHC.Arr.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s b
</span><a href="#local-6989586621679500667"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500662"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679500675"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500660"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; STRep s (Array i b)
</span><a href="#local-6989586621679500663"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500662"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500661"><span class="hs-identifier hs-var">s#</span></a></span><span>
</span><span id="line-449"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Int -&gt; STRep s (Array i b)
</span><a href="#local-6989586621679500663"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500668"><span class="hs-identifier hs-var">s2#</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span class="hs-comment">{- Note [amap]
~~~~~~~~~~~~~~
amap was originally defined like this:

 amap f arr@(Array l u n _) =
     unsafeArray' (l,u) n [(i, f (unsafeAt arr i)) | i &lt;- [0 .. n - 1]]

There are two problems:

1. The enumFromTo implementation produces (spurious) code for the impossible
   case of n&lt;0 that ends up duplicating the array freezing code.

2. This implementation relies on list fusion for efficiency. In order
   to implement the &quot;amap/coerce&quot; rule, we need to delay inlining amap
   until simplifier phase 1, which is when the eftIntList rule kicks
   in and makes that impossible.  (c.f. #8767)
-}</span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span class="hs-comment">-- See Breitner, Eisenberg, Peyton Jones, and Weirich, &quot;Safe Zero-cost</span><span>
</span><span id="line-471"></span><span class="hs-comment">-- Coercions for Haskell&quot;, section 6.5:</span><span>
</span><span id="line-472"></span><span class="hs-comment">--   http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/coercible.pdf</span><span>
</span><span id="line-473"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-474"></span><span class="annot"><span class="hs-pragma">&quot;amap/coerce&quot;</span></span><span> </span><span class="annot"><a href="GHC.Arr.html#amap"><span class="hs-pragma hs-type">amap</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#coerce"><span class="hs-pragma hs-type">coerce</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#coerce"><span class="hs-pragma hs-type">coerce</span></a></span><span>  </span><span class="hs-pragma">-- See Note [amap]</span><span>
</span><span id="line-475"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-476"></span><span>
</span><span id="line-477"></span><span class="hs-comment">-- Second functor law:</span><span>
</span><span id="line-478"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-479"></span><span class="annot"><span class="hs-pragma">&quot;amap/amap&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679500659"><span class="annot"><a href="#local-6989586621679500659"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500658"><span class="annot"><a href="#local-6989586621679500658"><span class="hs-pragma hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679500657"><span class="annot"><a href="#local-6989586621679500657"><span class="hs-pragma hs-var">a</span></a></span></span><span> </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="GHC.Arr.html#amap"><span class="hs-pragma hs-type">amap</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500659"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Arr.html#amap"><span class="hs-pragma hs-type">amap</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500658"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500657"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Arr.html#amap"><span class="hs-pragma hs-type">amap</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679500659"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#."><span class="hs-pragma hs-type">.</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500658"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679500657"><span class="hs-pragma hs-type">a</span></a></span><span>
</span><span id="line-480"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-481"></span><span>
</span><span id="line-482"></span><span class="hs-comment">-- | 'ixmap' allows for transformations on array indices.</span><span>
</span><span id="line-483"></span><span class="hs-comment">-- It may be thought of as providing function composition on the right</span><span>
</span><span id="line-484"></span><span class="hs-comment">-- with the mapping that the original array embodies.</span><span>
</span><span id="line-485"></span><span class="hs-comment">--</span><span>
</span><span id="line-486"></span><span class="hs-comment">-- A similar transformation of array values may be achieved using 'fmap'</span><span>
</span><span id="line-487"></span><span class="hs-comment">-- from the 'Array' instance of the 'Functor' class.</span><span>
</span><span id="line-488"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#ixmap"><span class="hs-pragma hs-type">ixmap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-489"></span><span id="local-6989586621679501177"><span id="local-6989586621679501178"><span id="local-6989586621679501179"><span class="annot"><a href="GHC.Arr.html#ixmap"><span class="hs-identifier hs-type">ixmap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501179"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501178"><span class="hs-identifier hs-type">j</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501179"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501179"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501179"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501178"><span class="hs-identifier hs-type">j</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501178"><span class="hs-identifier hs-type">j</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501177"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501179"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501177"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-490"></span><span id="ixmap"><span class="annot"><span class="annottext">ixmap :: forall i j e.
(Ix i, Ix j) =&gt;
(i, i) -&gt; (i -&gt; j) -&gt; Array j e -&gt; Array i e
</span><a href="GHC.Arr.html#ixmap"><span class="hs-identifier hs-var hs-var">ixmap</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500650"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500650"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500649"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500649"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500648"><span class="annot"><span class="annottext">i -&gt; j
</span><a href="#local-6989586621679500648"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679500647"><span class="annot"><span class="annottext">Array j e
</span><a href="#local-6989586621679500647"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-491"></span><span>    </span><span class="annot"><span class="annottext">(i, i) -&gt; [(i, e)] -&gt; Array i e
forall i e. Ix i =&gt; (i, i) -&gt; [(i, e)] -&gt; Array i e
</span><a href="GHC.Arr.html#array"><span class="hs-identifier hs-var">array</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500650"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500649"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500646"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Array j e
</span><a href="#local-6989586621679500647"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Array j e -&gt; j -&gt; e
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">i -&gt; j
</span><a href="#local-6989586621679500648"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500646"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679500646"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500646"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; [i]
forall a. Ix a =&gt; (a, a) -&gt; [a]
</span><a href="GHC.Ix.html#range"><span class="hs-identifier hs-var">range</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500650"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500649"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-492"></span><span>
</span><span id="line-493"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#eqArray"><span class="hs-pragma hs-type">eqArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-494"></span><span id="local-6989586621679501172"><span id="local-6989586621679501173"><span class="annot"><a href="GHC.Arr.html#eqArray"><span class="hs-identifier hs-type">eqArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501173"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501172"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501173"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501172"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501173"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501172"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span></span></span><span>
</span><span id="line-495"></span><span id="eqArray"><span class="annot"><span class="annottext">eqArray :: forall i e. (Ix i, Eq e) =&gt; Array i e -&gt; Array i e -&gt; Bool
</span><a href="GHC.Arr.html#eqArray"><span class="hs-identifier hs-var hs-var">eqArray</span></a></span></span><span> </span><span id="local-6989586621679500629"><span class="annot"><span class="annottext">arr1 :: Array i e
</span><a href="#local-6989586621679500629"><span class="hs-identifier hs-var">arr1</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500628"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500628"><span class="hs-identifier hs-var">l1</span></a></span></span><span> </span><span id="local-6989586621679500627"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500627"><span class="hs-identifier hs-var">u1</span></a></span></span><span> </span><span id="local-6989586621679500626"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500626"><span class="hs-identifier hs-var">n1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500625"><span class="annot"><span class="annottext">arr2 :: Array i e
</span><a href="#local-6989586621679500625"><span class="hs-identifier hs-var">arr2</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500624"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500624"><span class="hs-identifier hs-var">l2</span></a></span></span><span> </span><span id="local-6989586621679500623"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500623"><span class="hs-identifier hs-var">u2</span></a></span></span><span> </span><span id="local-6989586621679500622"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500622"><span class="hs-identifier hs-var">n2</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-496"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500626"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500622"><span class="hs-identifier hs-var">n2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-497"></span><span>    </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500628"><span class="hs-identifier hs-var">l1</span></a></span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500624"><span class="hs-identifier hs-var">l2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500627"><span class="hs-identifier hs-var">u1</span></a></span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500623"><span class="hs-identifier hs-var">u2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span>
</span><span id="line-498"></span><span>    </span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
</span><a href="GHC.List.html#and"><span class="hs-identifier hs-var">and</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Array i e -&gt; Int -&gt; e
forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var">unsafeAt</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500629"><span class="hs-identifier hs-var">arr1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500620"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; e -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; Int -&gt; e
forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var">unsafeAt</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500625"><span class="hs-identifier hs-var">arr2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500620"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679500620"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500620"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500626"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span class="hs-special">]</span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Arr.html#cmpArray"><span class="hs-pragma hs-type">cmpArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-501"></span><span id="local-6989586621679501168"><span id="local-6989586621679501169"><span class="annot"><a href="GHC.Arr.html#cmpArray"><span class="hs-identifier hs-type">cmpArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501169"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501168"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501169"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501168"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501169"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501168"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier hs-type">Ordering</span></a></span></span></span><span>
</span><span id="line-502"></span><span id="cmpArray"><span class="annot"><span class="annottext">cmpArray :: forall i e. (Ix i, Ord e) =&gt; Array i e -&gt; Array i e -&gt; Ordering
</span><a href="GHC.Arr.html#cmpArray"><span class="hs-identifier hs-var hs-var">cmpArray</span></a></span></span><span> </span><span id="local-6989586621679500610"><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500610"><span class="hs-identifier hs-var">arr1</span></a></span></span><span> </span><span id="local-6989586621679500609"><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500609"><span class="hs-identifier hs-var">arr2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(i, e)] -&gt; [(i, e)] -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#compare"><span class="hs-identifier hs-var">compare</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array i e -&gt; [(i, e)]
forall i e. Ix i =&gt; Array i e -&gt; [(i, e)]
</span><a href="GHC.Arr.html#assocs"><span class="hs-identifier hs-var">assocs</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500610"><span class="hs-identifier hs-var">arr1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array i e -&gt; [(i, e)]
forall i e. Ix i =&gt; Array i e -&gt; [(i, e)]
</span><a href="GHC.Arr.html#assocs"><span class="hs-identifier hs-var">assocs</span></a></span><span> </span><span class="annot"><span class="annottext">Array i e
</span><a href="#local-6989586621679500609"><span class="hs-identifier hs-var">arr2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#cmpIntArray"><span class="hs-pragma hs-type">cmpIntArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-505"></span><span id="local-6989586621679501162"><span class="annot"><a href="GHC.Arr.html#cmpIntArray"><span class="hs-identifier hs-type">cmpIntArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501162"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501162"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501162"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier hs-type">Ordering</span></a></span></span><span>
</span><span id="line-506"></span><span id="cmpIntArray"><span class="annot"><span class="annottext">cmpIntArray :: forall e. Ord e =&gt; Array Int e -&gt; Array Int e -&gt; Ordering
</span><a href="GHC.Arr.html#cmpIntArray"><span class="hs-identifier hs-var hs-var">cmpIntArray</span></a></span></span><span> </span><span id="local-6989586621679500593"><span class="annot"><span class="annottext">arr1 :: Array Int e
</span><a href="#local-6989586621679500593"><span class="hs-identifier hs-var">arr1</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500592"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500592"><span class="hs-identifier hs-var">l1</span></a></span></span><span> </span><span id="local-6989586621679500591"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500591"><span class="hs-identifier hs-var">u1</span></a></span></span><span> </span><span id="local-6989586621679500590"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500590"><span class="hs-identifier hs-var">n1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500589"><span class="annot"><span class="annottext">arr2 :: Array Int e
</span><a href="#local-6989586621679500589"><span class="hs-identifier hs-var">arr2</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500588"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500588"><span class="hs-identifier hs-var">l2</span></a></span></span><span> </span><span id="local-6989586621679500587"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500587"><span class="hs-identifier hs-var">u2</span></a></span></span><span> </span><span id="local-6989586621679500586"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500586"><span class="hs-identifier hs-var">n2</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-507"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500590"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-508"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500586"><span class="hs-identifier hs-var">n2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#LT"><span class="hs-identifier hs-var">LT</span></a></span><span>
</span><span id="line-509"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500586"><span class="hs-identifier hs-var">n2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#GT"><span class="hs-identifier hs-var">GT</span></a></span><span>
</span><span id="line-510"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#compare"><span class="hs-identifier hs-var">compare</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500592"><span class="hs-identifier hs-var">l1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500588"><span class="hs-identifier hs-var">l2</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-511"></span><span>             </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Ordering -&gt; Ordering) -&gt; Ordering -&gt; [Int] -&gt; Ordering
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Ordering -&gt; Ordering
</span><a href="#local-6989586621679500585"><span class="hs-identifier hs-var">cmp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#compare"><span class="hs-identifier hs-var">compare</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500591"><span class="hs-identifier hs-var">u1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500587"><span class="hs-identifier hs-var">u2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500590"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><a href="../../ghc-prim/src/GHC.Classes.html#min"><span class="hs-operator hs-var">`min`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500586"><span class="hs-identifier hs-var">n2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span>
</span><span id="line-512"></span><span>             </span><span id="local-6989586621679500583"><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679500583"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679500583"><span class="hs-identifier hs-var">other</span></a></span><span>
</span><span id="line-513"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-514"></span><span>    </span><span id="local-6989586621679500585"><span class="annot"><span class="annottext">cmp :: Int -&gt; Ordering -&gt; Ordering
</span><a href="#local-6989586621679500585"><span class="hs-identifier hs-var hs-var">cmp</span></a></span></span><span> </span><span id="local-6989586621679500581"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500581"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679500580"><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679500580"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">e -&gt; e -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#compare"><span class="hs-identifier hs-var">compare</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array Int e -&gt; Int -&gt; e
forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var">unsafeAt</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int e
</span><a href="#local-6989586621679500593"><span class="hs-identifier hs-var">arr1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500581"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array Int e -&gt; Int -&gt; e
forall i e. Array i e -&gt; Int -&gt; e
</span><a href="GHC.Arr.html#unsafeAt"><span class="hs-identifier hs-var">unsafeAt</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int e
</span><a href="#local-6989586621679500589"><span class="hs-identifier hs-var">arr2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500581"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-515"></span><span>        </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679500580"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-516"></span><span>        </span><span id="local-6989586621679500579"><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679500579"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679500579"><span class="hs-identifier hs-var">other</span></a></span><span>
</span><span id="line-517"></span><span>
</span><span id="line-518"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;cmpArray/Int&quot;</span></span><span> </span><span class="annot"><a href="GHC.Arr.html#cmpArray"><span class="hs-pragma hs-type">cmpArray</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Arr.html#cmpIntArray"><span class="hs-pragma hs-type">cmpIntArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-519"></span><span>
</span><span id="line-520"></span><span class="hs-comment">----------------------------------------------------------------------</span><span>
</span><span id="line-521"></span><span class="hs-comment">-- Array instances</span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-524"></span><span id="local-6989586621679501154"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501154"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-525"></span><span>    </span><span id="local-6989586621679500574"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Array i a -&gt; Array i b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Array i a -&gt; Array i b
forall a b i. (a -&gt; b) -&gt; Array i a -&gt; Array i b
</span><a href="GHC.Arr.html#amap"><span class="hs-identifier hs-var">amap</span></a></span><span>
</span><span id="line-526"></span><span>
</span><span id="line-527"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;$</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-528"></span><span>    </span><span id="local-6989586621679500572"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500572"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679500571"><span class="annot"><span class="annottext">&lt;$ :: forall a b. a -&gt; Array i b -&gt; Array i a
</span><a href="#local-6989586621679500571"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;$</span></a></span></span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500570"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500570"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500569"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500569"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500568"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500568"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500567"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500567"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Array# b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-529"></span><span>        </span><span class="hs-comment">-- Sadly we can't just use 'newSTArray' (with 'unsafeFreezeSTArray')</span><span>
</span><span id="line-530"></span><span>        </span><span class="hs-comment">-- since that would require proof that the indices of the original array</span><span>
</span><span id="line-531"></span><span>        </span><span class="hs-comment">-- are instances of 'Ix'.</span><span>
</span><span id="line-532"></span><span>        </span><span class="annot"><span class="annottext">(forall s. ST s (Array i a)) -&gt; Array i a
forall a. (forall s. ST s a) -&gt; a
</span><a href="GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="annot"><span class="annottext">((forall s. ST s (Array i a)) -&gt; Array i a)
-&gt; (forall s. ST s (Array i a)) -&gt; Array i a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">STRep s (Array i a) -&gt; ST s (Array i a)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (Array i a) -&gt; ST s (Array i a))
-&gt; STRep s (Array i a) -&gt; ST s (Array i a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500566"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500566"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-533"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; a -&gt; State# s -&gt; (# State# s, MutableArray# s a #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500567"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679500572"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500566"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-534"></span><span>                </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500565"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500565"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500564"><span class="annot"><span class="annottext">MutableArray# s a
</span><a href="#local-6989586621679500564"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s a -&gt; STRep s (Array i a)
forall i s e.
i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STRep s (Array i e)
</span><a href="GHC.Arr.html#done"><span class="hs-identifier hs-var">done</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500570"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500569"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500568"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s a
</span><a href="#local-6989586621679500564"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500565"><span class="hs-identifier hs-var">s2#</span></a></span></span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-537"></span><span id="local-6989586621679501147"><span id="local-6989586621679501148"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679500561"><span class="hs-special">(</span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501148"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501147"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501148"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501147"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-538"></span><span>    </span><span id="local-6989586621679500558"><span class="annot"><span class="annottext">== :: Array i e -&gt; Array i e -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">(==)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; Array i e -&gt; Bool
forall i e. (Ix i, Eq e) =&gt; Array i e -&gt; Array i e -&gt; Bool
</span><a href="GHC.Arr.html#eqArray"><span class="hs-identifier hs-var">eqArray</span></a></span></span></span><span>
</span><span id="line-539"></span><span>
</span><span id="line-540"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-541"></span><span id="local-6989586621679501145"><span id="local-6989586621679501146"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679500543"><span id="local-6989586621679500545"><span id="local-6989586621679500547"><span id="local-6989586621679500549"><span id="local-6989586621679500551"><span id="local-6989586621679500553"><span class="hs-special">(</span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501146"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501145"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501146"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501145"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-542"></span><span>    </span><span id="local-6989586621679500539"><span class="annot"><span class="annottext">compare :: Array i e -&gt; Array i e -&gt; Ordering
</span><a href="#local-6989586621679500539"><span class="hs-identifier hs-var hs-var hs-var hs-var">compare</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array i e -&gt; Array i e -&gt; Ordering
forall i e. (Ix i, Ord e) =&gt; Array i e -&gt; Array i e -&gt; Ordering
</span><a href="GHC.Arr.html#cmpArray"><span class="hs-identifier hs-var">cmpArray</span></a></span></span></span><span>
</span><span id="line-543"></span><span>
</span><span id="line-544"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-545"></span><span id="local-6989586621679501143"><span id="local-6989586621679501144"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679500534"><span id="local-6989586621679500536"><span class="hs-special">(</span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501144"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501144"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501143"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501144"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501143"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-546"></span><span>    </span><span id="local-6989586621679500525"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Array a b -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span id="local-6989586621679500523"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500523"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679500522"><span class="annot"><span class="annottext">Array a b
</span><a href="#local-6989586621679500522"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-547"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; ([Char] -&gt; [Char]) -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Show.html#showParen"><span class="hs-identifier hs-var">showParen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500523"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Show.html#appPrec"><span class="hs-identifier hs-var">appPrec</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([Char] -&gt; [Char]) -&gt; [Char] -&gt; [Char])
-&gt; ([Char] -&gt; [Char]) -&gt; [Char] -&gt; [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-548"></span><span>        </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;array &quot;</span></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; [Char]) -&gt; ([Char] -&gt; [Char]) -&gt; [Char] -&gt; [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span>
</span><span id="line-549"></span><span>        </span><span class="annot"><span class="annottext">Int -&gt; (a, a) -&gt; [Char] -&gt; [Char]
forall a. Show a =&gt; Int -&gt; a -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Show.html#appPrec1"><span class="hs-identifier hs-var">appPrec1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array a b -&gt; (a, a)
forall i e. Array i e -&gt; (i, i)
</span><a href="GHC.Arr.html#bounds"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">Array a b
</span><a href="#local-6989586621679500522"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; [Char]) -&gt; ([Char] -&gt; [Char]) -&gt; [Char] -&gt; [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span>
</span><span id="line-550"></span><span>        </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Show.html#showChar"><span class="hs-identifier hs-var">showChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; [Char]) -&gt; ([Char] -&gt; [Char]) -&gt; [Char] -&gt; [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span>
</span><span id="line-551"></span><span>        </span><span class="annot"><span class="annottext">Int -&gt; [(a, b)] -&gt; [Char] -&gt; [Char]
forall a. Show a =&gt; Int -&gt; a -&gt; [Char] -&gt; [Char]
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Show.html#appPrec1"><span class="hs-identifier hs-var">appPrec1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array a b -&gt; [(a, b)]
forall i e. Ix i =&gt; Array i e -&gt; [(i, e)]
</span><a href="GHC.Arr.html#assocs"><span class="hs-identifier hs-var">assocs</span></a></span><span> </span><span class="annot"><span class="annottext">Array a b
</span><a href="#local-6989586621679500522"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-552"></span><span>        </span><span class="hs-comment">-- Precedence of 'array' is the precedence of application</span><span>
</span><span id="line-553"></span><span>
</span><span id="line-554"></span><span class="hs-comment">-- The Read instance is in GHC.Read</span><span>
</span><span id="line-555"></span><span>
</span><span id="line-556"></span><span class="hs-comment">----------------------------------------------------------------------</span><span>
</span><span id="line-557"></span><span class="hs-comment">-- Operations on mutable arrays</span><span>
</span><span id="line-558"></span><span>
</span><span id="line-559"></span><span class="hs-comment">{-
Idle ADR question: What's the tradeoff here between flattening these
datatypes into @STArray ix ix (MutableArray# s elt)@ and using
it as is?  As I see it, the former uses slightly less heap and
provides faster access to the individual parts of the bounds while the
code used has the benefit of providing a ready-made @(lo, hi)@ pair as
required by many array-related functions.  Which wins? Is the
difference significant (probably not).

Idle AJG answer: When I looked at the outputted code (though it was 2
years ago) it seems like you often needed the tuple, and we build
it frequently. Now we've got the overloading specialiser things
might be different, though.
-}</span><span>
</span><span id="line-573"></span><span>
</span><span id="line-574"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#newSTArray"><span class="hs-pragma hs-type">newSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-575"></span><span id="local-6989586621679501134"><span id="local-6989586621679501135"><span id="local-6989586621679501136"><span class="annot"><a href="GHC.Arr.html#newSTArray"><span class="hs-identifier hs-type">newSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501136"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501136"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501136"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501135"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501134"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501134"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501136"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501135"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-576"></span><span id="newSTArray"><span class="annot"><span class="annottext">newSTArray :: forall i e s. Ix i =&gt; (i, i) -&gt; e -&gt; ST s (STArray s i e)
</span><a href="GHC.Arr.html#newSTArray"><span class="hs-identifier hs-var hs-var">newSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679500513"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500513"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679500512"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500512"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500511"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500511"><span class="hs-identifier hs-var">initial</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s (STArray s i e) -&gt; ST s (STArray s i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (STArray s i e) -&gt; ST s (STArray s i e))
-&gt; STRep s (STArray s i e) -&gt; ST s (STArray s i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500510"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500510"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-577"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int
</span><a href="GHC.Arr.html#safeRangeSize"><span class="hs-identifier hs-var">safeRangeSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500513"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500512"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>            </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679500509"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500509"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500508"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500508"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-578"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; e -&gt; State# s -&gt; (# State# s, MutableArray# s e #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500508"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500511"><span class="hs-identifier hs-var">initial</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500510"><span class="hs-identifier hs-var">s1#</span></a></span><span>       </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500507"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500507"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500506"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500506"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-579"></span><span>    </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500507"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STArray s i e
forall s i e. i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STArray s i e
</span><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-var">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500513"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500512"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500509"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500506"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-580"></span><span>
</span><span id="line-581"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#boundsSTArray"><span class="hs-pragma hs-type">boundsSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-582"></span><span id="local-6989586621679501125"><span id="local-6989586621679501126"><span id="local-6989586621679501127"><span class="annot"><a href="GHC.Arr.html#boundsSTArray"><span class="hs-identifier hs-type">boundsSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501127"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501126"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501125"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679501126"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679501126"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-583"></span><span id="boundsSTArray"><span class="annot"><span class="annottext">boundsSTArray :: forall s i e. STArray s i e -&gt; (i, i)
</span><a href="GHC.Arr.html#boundsSTArray"><span class="hs-identifier hs-var hs-var">boundsSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span id="local-6989586621679500505"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500505"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500504"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500504"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500505"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500504"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span>
</span><span id="line-585"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#numElementsSTArray"><span class="hs-pragma hs-type">numElementsSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-586"></span><span id="local-6989586621679501119"><span id="local-6989586621679501120"><span id="local-6989586621679501121"><span class="annot"><a href="GHC.Arr.html#numElementsSTArray"><span class="hs-identifier hs-type">numElementsSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501121"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501120"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501119"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span></span></span></span><span>
</span><span id="line-587"></span><span id="numElementsSTArray"><span class="annot"><span class="annottext">numElementsSTArray :: forall s i e. STArray s i e -&gt; Int
</span><a href="GHC.Arr.html#numElementsSTArray"><span class="hs-identifier hs-var hs-var">numElementsSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500503"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500503"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500503"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-588"></span><span>
</span><span id="line-589"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#readSTArray"><span class="hs-pragma hs-type">readSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-590"></span><span id="local-6989586621679501113"><span id="local-6989586621679501114"><span id="local-6989586621679501115"><span class="annot"><a href="GHC.Arr.html#readSTArray"><span class="hs-identifier hs-type">readSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501115"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501114"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501115"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501113"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501115"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501114"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501113"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-591"></span><span id="readSTArray"><span class="annot"><span class="annottext">readSTArray :: forall i s e. Ix i =&gt; STArray s i e -&gt; i -&gt; ST s e
</span><a href="GHC.Arr.html#readSTArray"><span class="hs-identifier hs-var hs-var">readSTArray</span></a></span></span><span> </span><span id="local-6989586621679500500"><span class="annot"><span class="annottext">marr :: STArray s i e
</span><a href="#local-6989586621679500500"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span id="local-6989586621679500499"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500499"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500498"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500498"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500497"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500497"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500496"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500496"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-592"></span><span>    </span><span class="annot"><span class="annottext">STArray s i e -&gt; Int -&gt; ST s e
forall s i e. STArray s i e -&gt; Int -&gt; ST s e
</span><a href="GHC.Arr.html#unsafeReadSTArray"><span class="hs-identifier hs-var">unsafeReadSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray s i e
</span><a href="#local-6989586621679500500"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500499"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500498"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500497"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500496"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-593"></span><span>
</span><span id="line-594"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeReadSTArray"><span class="hs-pragma hs-type">unsafeReadSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-595"></span><span id="local-6989586621679501107"><span id="local-6989586621679501108"><span id="local-6989586621679501109"><span class="annot"><a href="GHC.Arr.html#unsafeReadSTArray"><span class="hs-identifier hs-type">unsafeReadSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501109"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501108"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501107"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501109"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501107"><span class="hs-identifier hs-type">e</span></a></span></span></span></span><span>
</span><span id="line-596"></span><span id="unsafeReadSTArray"><span class="annot"><span class="annottext">unsafeReadSTArray :: forall s i e. STArray s i e -&gt; Int -&gt; ST s e
</span><a href="GHC.Arr.html#unsafeReadSTArray"><span class="hs-identifier hs-var hs-var">unsafeReadSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500495"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500495"><span class="hs-identifier hs-var">marr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500494"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500494"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-597"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s e -&gt; ST s e
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s e -&gt; ST s e) -&gt; STRep s e -&gt; ST s e
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500493"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500493"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; STRep s e
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#readArray%23"><span class="hs-identifier hs-var">readArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500495"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500494"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500493"><span class="hs-identifier hs-var">s1#</span></a></span><span>
</span><span id="line-598"></span><span>
</span><span id="line-599"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#writeSTArray"><span class="hs-pragma hs-type">writeSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-600"></span><span id="local-6989586621679501101"><span id="local-6989586621679501102"><span id="local-6989586621679501103"><span class="annot"><a href="GHC.Arr.html#writeSTArray"><span class="hs-identifier hs-type">writeSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501103"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501102"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501103"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501101"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501103"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501101"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501102"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-601"></span><span id="writeSTArray"><span class="annot"><span class="annottext">writeSTArray :: forall i s e. Ix i =&gt; STArray s i e -&gt; i -&gt; e -&gt; ST s ()
</span><a href="GHC.Arr.html#writeSTArray"><span class="hs-identifier hs-var hs-var">writeSTArray</span></a></span></span><span> </span><span id="local-6989586621679500490"><span class="annot"><span class="annottext">marr :: STArray s i e
</span><a href="#local-6989586621679500490"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span id="local-6989586621679500489"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500489"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500488"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500488"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500487"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500487"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500486"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500486"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679500485"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500485"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-602"></span><span>    </span><span class="annot"><span class="annottext">STArray s i e -&gt; Int -&gt; e -&gt; ST s ()
forall s i e. STArray s i e -&gt; Int -&gt; e -&gt; ST s ()
</span><a href="GHC.Arr.html#unsafeWriteSTArray"><span class="hs-identifier hs-var">unsafeWriteSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray s i e
</span><a href="#local-6989586621679500490"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(i, i) -&gt; Int -&gt; i -&gt; Int
forall i. Ix i =&gt; (i, i) -&gt; Int -&gt; i -&gt; Int
</span><a href="GHC.Arr.html#safeIndex"><span class="hs-identifier hs-var">safeIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500489"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500488"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500487"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500486"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500485"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-603"></span><span>
</span><span id="line-604"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeWriteSTArray"><span class="hs-pragma hs-type">unsafeWriteSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-605"></span><span id="local-6989586621679501095"><span id="local-6989586621679501096"><span id="local-6989586621679501097"><span class="annot"><a href="GHC.Arr.html#unsafeWriteSTArray"><span class="hs-identifier hs-type">unsafeWriteSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501097"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501096"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501095"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679501095"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501097"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-606"></span><span id="unsafeWriteSTArray"><span class="annot"><span class="annottext">unsafeWriteSTArray :: forall s i e. STArray s i e -&gt; Int -&gt; e -&gt; ST s ()
</span><a href="GHC.Arr.html#unsafeWriteSTArray"><span class="hs-identifier hs-var hs-var">unsafeWriteSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">i
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679500484"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500484"><span class="hs-identifier hs-var">marr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500483"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500483"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500482"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500482"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s () -&gt; ST s ()
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s () -&gt; ST s ()) -&gt; STRep s () -&gt; ST s ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500481"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500481"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-607"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; e -&gt; State# s -&gt; State# s
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeArray%23"><span class="hs-identifier hs-var">writeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500484"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500483"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500482"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500481"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-608"></span><span>        </span><span id="local-6989586621679500480"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500480"><span class="hs-identifier hs-var">s2#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500480"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-609"></span><span>
</span><span id="line-610"></span><span class="hs-comment">----------------------------------------------------------------------</span><span>
</span><span id="line-611"></span><span class="hs-comment">-- Moving between mutable and immutable</span><span>
</span><span id="line-612"></span><span>
</span><span id="line-613"></span><span id="local-6989586621679501089"><span id="local-6989586621679501090"><span id="local-6989586621679501091"><span class="annot"><a href="GHC.Arr.html#freezeSTArray"><span class="hs-identifier hs-type">freezeSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501091"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501090"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501089"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501091"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501090"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501089"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-614"></span><span id="freezeSTArray"><span class="annot"><span class="annottext">freezeSTArray :: forall s i e. STArray s i e -&gt; ST s (Array i e)
</span><a href="GHC.Arr.html#freezeSTArray"><span class="hs-identifier hs-var hs-var">freezeSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span id="local-6989586621679500479"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500479"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500478"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500478"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500477"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500477"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500476"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500476"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500475"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500475"><span class="hs-identifier hs-var">marr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s (Array i e) -&gt; ST s (Array i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (Array i e) -&gt; ST s (Array i e))
-&gt; STRep s (Array i e) -&gt; ST s (Array i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500474"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500474"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-615"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; e -&gt; State# s -&gt; (# State# s, MutableArray# s e #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500476"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">e
forall a. a
</span><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier hs-var">arrEleBottom</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500474"><span class="hs-identifier hs-var">s1#</span></a></span><span>  </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500473"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500473"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500472"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500472"><span class="hs-identifier hs-var">marr'#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-616"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679500471"><span class="annot"><span class="annottext">copy :: Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500471"><span class="hs-identifier hs-var hs-var">copy</span></a></span></span><span> </span><span id="local-6989586621679500470"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500470"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span id="local-6989586621679500469"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500469"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500470"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3D%3D%23"><span class="hs-operator hs-var">==#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500476"><span class="hs-identifier hs-var">n#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500469"><span class="hs-identifier hs-var">s3#</span></a></span><span>
</span><span id="line-617"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-618"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; State# s -&gt; (# State# s, e #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#readArray%23"><span class="hs-identifier hs-var">readArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500475"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500470"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500469"><span class="hs-identifier hs-var">s3#</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500468"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500468"><span class="hs-identifier hs-var">s4#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500467"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500467"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-619"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; e -&gt; State# s -&gt; State# s
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeArray%23"><span class="hs-identifier hs-var">writeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500472"><span class="hs-identifier hs-var">marr'#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500470"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500467"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500468"><span class="hs-identifier hs-var">s4#</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679500466"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500466"><span class="hs-identifier hs-var">s5#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-620"></span><span>            </span><span class="annot"><span class="annottext">Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500471"><span class="hs-identifier hs-var">copy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500470"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500466"><span class="hs-identifier hs-var">s5#</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-621"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500471"><span class="hs-identifier hs-var">copy</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500473"><span class="hs-identifier hs-var">s2#</span></a></span><span>                    </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679500465"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500465"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-622"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; State# s -&gt; (# State# s, Array# e #)
forall d a.
MutableArray# d a -&gt; State# d -&gt; (# State# d, Array# a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#unsafeFreezeArray%23"><span class="hs-identifier hs-var">unsafeFreezeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500472"><span class="hs-identifier hs-var">marr'#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500465"><span class="hs-identifier hs-var">s3#</span></a></span><span>  </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500464"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500464"><span class="hs-identifier hs-var">s4#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500463"><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500463"><span class="hs-identifier hs-var">arr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-623"></span><span>    </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500464"><span class="hs-identifier hs-var">s4#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; Array# e -&gt; Array i e
forall i e. i -&gt; i -&gt; Int -&gt; Array# e -&gt; Array i e
</span><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-var">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500479"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500478"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500477"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500463"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-624"></span><span>
</span><span id="line-625"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeFreezeSTArray"><span class="hs-pragma hs-type">unsafeFreezeSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-626"></span><span id="local-6989586621679500460"><span id="local-6989586621679500461"><span id="local-6989586621679500462"><span class="annot"><a href="GHC.Arr.html#unsafeFreezeSTArray"><span class="hs-identifier hs-type">unsafeFreezeSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500462"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500461"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500460"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500462"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500461"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500460"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-627"></span><span id="unsafeFreezeSTArray"><span class="annot"><span class="annottext">unsafeFreezeSTArray :: forall s i e. STArray s i e -&gt; ST s (Array i e)
</span><a href="GHC.Arr.html#unsafeFreezeSTArray"><span class="hs-identifier hs-var hs-var">unsafeFreezeSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span id="local-6989586621679500459"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500459"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500458"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500458"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500457"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500457"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679500456"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500456"><span class="hs-identifier hs-var">marr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s (Array i e) -&gt; ST s (Array i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (Array i e) -&gt; ST s (Array i e))
-&gt; STRep s (Array i e) -&gt; ST s (Array i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500455"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500455"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-628"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; State# s -&gt; (# State# s, Array# e #)
forall d a.
MutableArray# d a -&gt; State# d -&gt; (# State# d, Array# a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#unsafeFreezeArray%23"><span class="hs-identifier hs-var">unsafeFreezeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500456"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500455"><span class="hs-identifier hs-var">s1#</span></a></span><span>   </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500454"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500454"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500453"><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500453"><span class="hs-identifier hs-var">arr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-629"></span><span>    </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500454"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; Array# e -&gt; Array i e
forall i e. i -&gt; i -&gt; Int -&gt; Array# e -&gt; Array i e
</span><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-var">Array</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500459"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500458"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500457"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500453"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-630"></span><span>
</span><span id="line-631"></span><span id="local-6989586621679501200"><span id="local-6989586621679501201"><span id="local-6989586621679501202"><span class="annot"><a href="GHC.Arr.html#thawSTArray"><span class="hs-identifier hs-type">thawSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501202"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501201"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501200"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501200"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501202"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679501201"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-632"></span><span id="thawSTArray"><span class="annot"><span class="annottext">thawSTArray :: forall i e s. Array i e -&gt; ST s (STArray s i e)
</span><a href="GHC.Arr.html#thawSTArray"><span class="hs-identifier hs-var hs-var">thawSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500452"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500452"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500451"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500451"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500450"><span class="annot"><span class="annottext">n :: Int
</span><a href="#local-6989586621679500450"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679500449"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500449"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679500448"><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500448"><span class="hs-identifier hs-var">arr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s (STArray s i e) -&gt; ST s (STArray s i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (STArray s i e) -&gt; ST s (STArray s i e))
-&gt; STRep s (STArray s i e) -&gt; ST s (STArray s i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500447"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500447"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-633"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; e -&gt; State# s -&gt; (# State# s, MutableArray# s e #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newArray%23"><span class="hs-identifier hs-var">newArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500449"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">e
forall a. a
</span><a href="GHC.Arr.html#arrEleBottom"><span class="hs-identifier hs-var">arrEleBottom</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500447"><span class="hs-identifier hs-var">s1#</span></a></span><span>  </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500446"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500446"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500445"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500445"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-634"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679500444"><span class="annot"><span class="annottext">copy :: Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500444"><span class="hs-identifier hs-var hs-var">copy</span></a></span></span><span> </span><span id="local-6989586621679500443"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500443"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span id="local-6989586621679500442"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500442"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500443"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3D%3D%23"><span class="hs-operator hs-var">==#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500449"><span class="hs-identifier hs-var">n#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500442"><span class="hs-identifier hs-var">s3#</span></a></span><span>
</span><span id="line-635"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-636"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Array# e -&gt; Int# -&gt; (# e #)
forall a. Array# a -&gt; Int# -&gt; (# a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#indexArray%23"><span class="hs-identifier hs-var">indexArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500448"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500443"><span class="hs-identifier hs-var">i#</span></a></span><span>    </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500441"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500441"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-637"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# s e -&gt; Int# -&gt; e -&gt; State# s -&gt; State# s
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeArray%23"><span class="hs-identifier hs-var">writeArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500445"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500443"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679500441"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500442"><span class="hs-identifier hs-var">s3#</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679500440"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500440"><span class="hs-identifier hs-var">s4#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-638"></span><span>            </span><span class="annot"><span class="annottext">Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500444"><span class="hs-identifier hs-var">copy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679500443"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500440"><span class="hs-identifier hs-var">s4#</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-639"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; State# s -&gt; State# s
</span><a href="#local-6989586621679500444"><span class="hs-identifier hs-var">copy</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500446"><span class="hs-identifier hs-var">s2#</span></a></span><span>                    </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679500439"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500439"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-640"></span><span>    </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500439"><span class="hs-identifier hs-var">s3#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STArray s i e
forall s i e. i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STArray s i e
</span><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-var">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500452"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500451"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500450"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500445"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-641"></span><span>
</span><span id="line-642"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Arr.html#unsafeThawSTArray"><span class="hs-pragma hs-type">unsafeThawSTArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-643"></span><span id="local-6989586621679500436"><span id="local-6989586621679500437"><span id="local-6989586621679500438"><span class="annot"><a href="GHC.Arr.html#unsafeThawSTArray"><span class="hs-identifier hs-type">unsafeThawSTArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500438"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500437"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500436"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500436"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500438"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679500437"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-644"></span><span id="unsafeThawSTArray"><span class="annot"><span class="annottext">unsafeThawSTArray :: forall i e s. Array i e -&gt; ST s (STArray s i e)
</span><a href="GHC.Arr.html#unsafeThawSTArray"><span class="hs-identifier hs-var hs-var">unsafeThawSTArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span id="local-6989586621679500435"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500435"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679500434"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500434"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679500433"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500433"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679500432"><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500432"><span class="hs-identifier hs-var">arr#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s (STArray s i e) -&gt; ST s (STArray s i e)
forall s a. STRep s a -&gt; ST s a
</span><a href="GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (STArray s i e) -&gt; ST s (STArray s i e))
-&gt; STRep s (STArray s i e) -&gt; ST s (STArray s i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679500431"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500431"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-645"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Array# e -&gt; State# s -&gt; (# State# s, MutableArray# s e #)
forall a d.
Array# a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#unsafeThawArray%23"><span class="hs-identifier hs-var">unsafeThawArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Array# e
</span><a href="#local-6989586621679500432"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500431"><span class="hs-identifier hs-var">s1#</span></a></span><span>      </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679500430"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500430"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679500429"><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500429"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-646"></span><span>    </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679500430"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STArray s i e
forall s i e. i -&gt; i -&gt; Int -&gt; MutableArray# s e -&gt; STArray s i e
</span><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-var">STArray</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500435"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679500434"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679500433"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# s e
</span><a href="#local-6989586621679500429"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-647"></span></pre></body></html>